Class Hologram

java.lang.Object
net.minestom.server.entity.hologram.Hologram
All Implemented Interfaces:
Viewable

public class Hologram
extends java.lang.Object
implements Viewable
Represents an invisible armor stand showing a ColoredText.
  • Constructor Details

  • Method Details

    • getPosition

      public Position getPosition()
      Gets the position of the hologram.
      Returns:
      the hologram's position
    • setPosition

      public void setPosition​(Position position)
      Changes the position of the hologram.
      Parameters:
      position - the new hologram's position
    • getText

      public ColoredText getText()
      Gets the hologram text.
      Returns:
      the hologram text
    • setText

      public void setText​(ColoredText text)
      Changes the hologram text.
      Parameters:
      text - the new hologram text
    • remove

      public void remove()
      Removes the hologram.
    • isRemoved

      public boolean isRemoved()
      Checks if the hologram is still present.
      Returns:
      true if the hologram is present, false otherwise
    • getEntity

      public net.minestom.server.entity.hologram.Hologram.HologramEntity getEntity()
      Gets the hologram entity (armor stand).
      Returns:
      the hologram entity
    • addViewer

      public boolean addViewer​(@NotNull Player player)
      Description copied from interface: Viewable
      Adds a viewer.
      Specified by:
      addViewer in interface Viewable
      Parameters:
      player - the viewer to add
      Returns:
      true if the player has been added, false otherwise (could be because he is already a viewer)
    • removeViewer

      public boolean removeViewer​(@NotNull Player player)
      Description copied from interface: Viewable
      Removes a viewer.
      Specified by:
      removeViewer in interface Viewable
      Parameters:
      player - the viewer to remove
      Returns:
      true if the player has been removed, false otherwise (could be because he was not a viewer)
    • getViewers

      @NotNull public java.util.Set<Player> getViewers()
      Description copied from interface: Viewable
      Gets all the viewers of this viewable element.
      Specified by:
      getViewers in interface Viewable
      Returns:
      A Set containing all the element's viewers