Interface Team


public interface Team
A team on a scoreboard that has a common display theme and other properties. This team is only relevant to the display of the associated scoreboard.
  • Method Summary

    Modifier and Type Method Description
    void addEntry​(java.lang.String entry)
    This puts the specified entry onto this team for the scoreboard.
    void addPlayer​(OfflinePlayer player)
    Deprecated.
    Teams can contain entries that aren't players
    boolean allowFriendlyFire()
    Gets the team friendly fire state
    boolean canSeeFriendlyInvisibles()
    Gets the team's ability to see invisible teammates.
    java.lang.String getDisplayName()
    Gets the name displayed to entries for this team
    java.util.Set<java.lang.String> getEntries()
    Gets the Set of entries on the team
    java.lang.String getName()
    Gets the name of this Team
    NameTagVisibility getNameTagVisibility()
    Gets the team's ability to see name tags
    java.util.Set<OfflinePlayer> getPlayers()
    Deprecated.
    Teams can contain entries that aren't players
    java.lang.String getPrefix()
    Gets the prefix prepended to the display of entries on this team.
    Scoreboard getScoreboard()
    Gets the Scoreboard to which this team is attached
    int getSize()
    Gets the size of the team
    java.lang.String getSuffix()
    Gets the suffix appended to the display of entries on this team.
    boolean hasEntry​(java.lang.String entry)
    Checks to see if the specified entry is a member of this team.
    boolean hasPlayer​(OfflinePlayer player)
    Deprecated.
    Teams can contain entries that aren't players
    boolean removeEntry​(java.lang.String entry)
    Removes the entry from this team.
    boolean removePlayer​(OfflinePlayer player)
    Deprecated.
    Teams can contain entries that aren't players
    void setAllowFriendlyFire​(boolean enabled)
    Sets the team friendly fire state
    void setCanSeeFriendlyInvisibles​(boolean enabled)
    Sets the team's ability to see invisible teammates.
    void setDisplayName​(java.lang.String displayName)
    Sets the name displayed to entries for this team
    void setNameTagVisibility​(NameTagVisibility visibility)
    Set's the team's ability to see name tags
    void setPrefix​(java.lang.String prefix)
    Sets the prefix prepended to the display of entries on this team.
    void setSuffix​(java.lang.String suffix)
    Sets the suffix appended to the display of entries on this team.
    void unregister()
    Unregisters this team from the Scoreboard
  • Method Details

    • getName

      java.lang.String getName() throws java.lang.IllegalStateException
      Gets the name of this Team
      Returns:
      Objective name
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • getDisplayName

      java.lang.String getDisplayName() throws java.lang.IllegalStateException
      Gets the name displayed to entries for this team
      Returns:
      Team display name
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • setDisplayName

      void setDisplayName​(java.lang.String displayName) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
      Sets the name displayed to entries for this team
      Parameters:
      displayName - New display name
      Throws:
      java.lang.IllegalArgumentException - if displayName is longer than 32 characters.
      java.lang.IllegalStateException - if this team has been unregistered
    • getPrefix

      java.lang.String getPrefix() throws java.lang.IllegalStateException
      Gets the prefix prepended to the display of entries on this team.
      Returns:
      Team prefix
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • setPrefix

      void setPrefix​(java.lang.String prefix) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
      Sets the prefix prepended to the display of entries on this team.
      Parameters:
      prefix - New prefix
      Throws:
      java.lang.IllegalArgumentException - if prefix is null
      java.lang.IllegalArgumentException - if prefix is longer than 16 characters
      java.lang.IllegalStateException - if this team has been unregistered
    • getSuffix

      java.lang.String getSuffix() throws java.lang.IllegalStateException
      Gets the suffix appended to the display of entries on this team.
      Returns:
      the team's current suffix
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • setSuffix

      void setSuffix​(java.lang.String suffix) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
      Sets the suffix appended to the display of entries on this team.
      Parameters:
      suffix - the new suffix for this team.
      Throws:
      java.lang.IllegalArgumentException - if suffix is null
      java.lang.IllegalArgumentException - if suffix is longer than 16 characters
      java.lang.IllegalStateException - if this team has been unregistered
    • allowFriendlyFire

      boolean allowFriendlyFire() throws java.lang.IllegalStateException
      Gets the team friendly fire state
      Returns:
      true if friendly fire is enabled
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • setAllowFriendlyFire

      void setAllowFriendlyFire​(boolean enabled) throws java.lang.IllegalStateException
      Sets the team friendly fire state
      Parameters:
      enabled - true if friendly fire is to be allowed
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • canSeeFriendlyInvisibles

      boolean canSeeFriendlyInvisibles() throws java.lang.IllegalStateException
      Gets the team's ability to see invisible teammates.
      Returns:
      true if team members can see invisible members
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • setCanSeeFriendlyInvisibles

      void setCanSeeFriendlyInvisibles​(boolean enabled) throws java.lang.IllegalStateException
      Sets the team's ability to see invisible teammates.
      Parameters:
      enabled - true if invisible teammates are to be visible
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • getNameTagVisibility

      NameTagVisibility getNameTagVisibility() throws java.lang.IllegalArgumentException
      Gets the team's ability to see name tags
      Returns:
      the current name tag visibilty for the team
      Throws:
      java.lang.IllegalArgumentException - if this team has been unregistered
    • setNameTagVisibility

      void setNameTagVisibility​(NameTagVisibility visibility) throws java.lang.IllegalArgumentException
      Set's the team's ability to see name tags
      Parameters:
      visibility - The nameTagVisibilty to set
      Throws:
      java.lang.IllegalArgumentException - if this team has been unregistered
    • getPlayers

      @Deprecated java.util.Set<OfflinePlayer> getPlayers() throws java.lang.IllegalStateException
      Deprecated.
      Teams can contain entries that aren't players
      Gets the Set of players on the team
      Returns:
      players on the team
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered\
      See Also:
      getEntries()
    • getEntries

      java.util.Set<java.lang.String> getEntries() throws java.lang.IllegalStateException
      Gets the Set of entries on the team
      Returns:
      entries on the team
      Throws:
      java.lang.IllegalStateException - if this entries has been unregistered\
    • getSize

      int getSize() throws java.lang.IllegalStateException
      Gets the size of the team
      Returns:
      number of entries on the team
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • getScoreboard

      Scoreboard getScoreboard()
      Gets the Scoreboard to which this team is attached
      Returns:
      Owning scoreboard, or null if this team has been unregistered
    • addPlayer

      @Deprecated void addPlayer​(OfflinePlayer player) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
      Deprecated.
      Teams can contain entries that aren't players
      This puts the specified player onto this team for the scoreboard.

      This will remove the player from any other team on the scoreboard.

      Parameters:
      player - the player to add
      Throws:
      java.lang.IllegalArgumentException - if player is null
      java.lang.IllegalStateException - if this team has been unregistered
      See Also:
      addEntry(String)
    • addEntry

      void addEntry​(java.lang.String entry) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
      This puts the specified entry onto this team for the scoreboard.

      This will remove the entry from any other team on the scoreboard.

      Parameters:
      entry - the entry to add
      Throws:
      java.lang.IllegalArgumentException - if entry is null
      java.lang.IllegalStateException - if this team has been unregistered
    • removePlayer

      @Deprecated boolean removePlayer​(OfflinePlayer player) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
      Deprecated.
      Teams can contain entries that aren't players
      Removes the player from this team.
      Parameters:
      player - the player to remove
      Returns:
      if the player was on this team
      Throws:
      java.lang.IllegalArgumentException - if player is null
      java.lang.IllegalStateException - if this team has been unregistered
      See Also:
      removeEntry(String)
    • removeEntry

      boolean removeEntry​(java.lang.String entry) throws java.lang.IllegalStateException, java.lang.IllegalArgumentException
      Removes the entry from this team.
      Parameters:
      entry - the entry to remove
      Returns:
      if the entry was a part of this team
      Throws:
      java.lang.IllegalArgumentException - if entry is null
      java.lang.IllegalStateException - if this team has been unregistered
    • unregister

      void unregister() throws java.lang.IllegalStateException
      Unregisters this team from the Scoreboard
      Throws:
      java.lang.IllegalStateException - if this team has been unregistered
    • hasPlayer

      @Deprecated boolean hasPlayer​(OfflinePlayer player) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
      Deprecated.
      Teams can contain entries that aren't players
      Checks to see if the specified player is a member of this team.
      Parameters:
      player - the player to search for
      Returns:
      true if the player is a member of this team
      Throws:
      java.lang.IllegalArgumentException - if player is null
      java.lang.IllegalStateException - if this team has been unregistered
      See Also:
      hasEntry(String)
    • hasEntry

      boolean hasEntry​(java.lang.String entry) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
      Checks to see if the specified entry is a member of this team.
      Parameters:
      entry - the entry to search for
      Returns:
      true if the entry is a member of this team
      Throws:
      java.lang.IllegalArgumentException - if entry is null
      java.lang.IllegalStateException - if this team has been unregistered