Package org.bukkit.scoreboard
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 playersboolean
allowFriendlyFire()
Gets the team friendly fire stateboolean
canSeeFriendlyInvisibles()
Gets the team's ability to seeinvisible
teammates.java.lang.String
getDisplayName()
Gets the name displayed to entries for this teamjava.util.Set<java.lang.String>
getEntries()
Gets the Set of entries on the teamjava.lang.String
getName()
Gets the name of this TeamNameTagVisibility
getNameTagVisibility()
Gets the team's ability to see name tagsjava.util.Set<OfflinePlayer>
getPlayers()
Deprecated.Teams can contain entries that aren't playersjava.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 attachedint
getSize()
Gets the size of the teamjava.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 playersboolean
removeEntry(java.lang.String entry)
Removes the entry from this team.boolean
removePlayer(OfflinePlayer player)
Deprecated.Teams can contain entries that aren't playersvoid
setAllowFriendlyFire(boolean enabled)
Sets the team friendly fire statevoid
setCanSeeFriendlyInvisibles(boolean enabled)
Sets the team's ability to seeinvisible
teammates.void
setDisplayName(java.lang.String displayName)
Sets the name displayed to entries for this teamvoid
setNameTagVisibility(NameTagVisibility visibility)
Set's the team's ability to see name tagsvoid
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.IllegalStateExceptionGets 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.IllegalStateExceptionGets 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.IllegalArgumentExceptionSets 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.IllegalStateExceptionGets 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.IllegalArgumentExceptionSets the prefix prepended to the display of entries on this team.- Parameters:
prefix
- New prefix- Throws:
java.lang.IllegalArgumentException
- if prefix is nulljava.lang.IllegalArgumentException
- if prefix is longer than 16 charactersjava.lang.IllegalStateException
- if this team has been unregistered
-
getSuffix
java.lang.String getSuffix() throws java.lang.IllegalStateExceptionGets 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.IllegalArgumentExceptionSets 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 nulljava.lang.IllegalArgumentException
- if suffix is longer than 16 charactersjava.lang.IllegalStateException
- if this team has been unregistered
-
allowFriendlyFire
boolean allowFriendlyFire() throws java.lang.IllegalStateExceptionGets 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.IllegalStateExceptionSets 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.IllegalStateExceptionGets the team's ability to seeinvisible
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.IllegalStateExceptionSets the team's ability to seeinvisible
teammates.- Parameters:
enabled
- true if invisible teammates are to be visible- Throws:
java.lang.IllegalStateException
- if this team has been unregistered
-
getNameTagVisibility
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
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.Teams can contain entries that aren't playersGets 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.IllegalStateExceptionGets 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.IllegalStateExceptionGets 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.IllegalArgumentExceptionDeprecated.Teams can contain entries that aren't playersThis 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 nulljava.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.IllegalArgumentExceptionThis 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 nulljava.lang.IllegalStateException
- if this team has been unregistered
-
removePlayer
@Deprecated boolean removePlayer(OfflinePlayer player) throws java.lang.IllegalStateException, java.lang.IllegalArgumentExceptionDeprecated.Teams can contain entries that aren't playersRemoves 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 nulljava.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.IllegalArgumentExceptionRemoves 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 nulljava.lang.IllegalStateException
- if this team has been unregistered
-
unregister
void unregister() throws java.lang.IllegalStateExceptionUnregisters 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.IllegalStateExceptionDeprecated.Teams can contain entries that aren't playersChecks 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 nulljava.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.IllegalStateExceptionChecks 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 nulljava.lang.IllegalStateException
- if this team has been unregistered
-