Class BelowNameTag

java.lang.Object
net.minestom.server.scoreboard.BelowNameTag
All Implemented Interfaces:
Audience, ForwardingAudience, Pointered, PacketGroupingAudience, Scoreboard, Viewable

public class BelowNameTag extends Object implements Scoreboard
Represents a scoreboard which rendered a tag below the name.
  • Field Details

    • BELOW_NAME_TAG_PREFIX

      public static final String BELOW_NAME_TAG_PREFIX
      WARNING: You shouldn't create scoreboards with the same prefix as those
      See Also:
  • Constructor Details

    • BelowNameTag

      public BelowNameTag(String name, Component value)
      Creates a new below name scoreboard.
      Parameters:
      name - The objective name of the scoreboard
      value - The value of the scoreboard
  • Method Details

    • getObjectiveName

      @NotNull public @NotNull String getObjectiveName()
      Description copied from interface: Scoreboard
      Gets the objective name of the scoreboard.
      Specified by:
      getObjectiveName in interface Scoreboard
      Returns:
      the objective name
    • addViewer

      public boolean addViewer(@NotNull @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 @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 @NotNull 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