Package org.bukkit.scoreboard
Interface Team
-
public interface TeamA team on a scoreboard that has a common display theme and other properties. This team is only relevant to the display of the associatedscoreboard.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTeam.OptionRepresents an option which may be applied to this team.static classTeam.OptionStatusHow an option may be applied to members of this team.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddEntry(String entry)This puts the specified entry onto this team for the scoreboard.voidaddPlayer(OfflinePlayer player)Deprecated.Teams can contain entries that aren't playersbooleanallowFriendlyFire()Gets the team friendly fire statebooleancanSeeFriendlyInvisibles()Gets the team's ability to seeinvisibleteammates.ChatColorgetColor()Gets the color of the team.StringgetDisplayName()Gets the name displayed to entries for this teamSet<String>getEntries()Gets the Set of entries on the teamStringgetName()Gets the name of this TeamNameTagVisibilitygetNameTagVisibility()Deprecated.Team.OptionStatusgetOption(Team.Option option)Get an option for this teamSet<OfflinePlayer>getPlayers()Deprecated.Teams can contain entries that aren't playersStringgetPrefix()Gets the prefix prepended to the display of entries on this team.ScoreboardgetScoreboard()Gets the Scoreboard to which this team is attachedintgetSize()Gets the size of the teamStringgetSuffix()Gets the suffix appended to the display of entries on this team.booleanhasEntry(String entry)Checks to see if the specified entry is a member of this team.booleanhasPlayer(OfflinePlayer player)Deprecated.Teams can contain entries that aren't playersbooleanremoveEntry(String entry)Removes the entry from this team.booleanremovePlayer(OfflinePlayer player)Deprecated.Teams can contain entries that aren't playersvoidsetAllowFriendlyFire(boolean enabled)Sets the team friendly fire statevoidsetCanSeeFriendlyInvisibles(boolean enabled)Sets the team's ability to seeinvisibleteammates.voidsetColor(ChatColor color)Sets the color of the team.voidsetDisplayName(String displayName)Sets the name displayed to entries for this teamvoidsetNameTagVisibility(NameTagVisibility visibility)voidsetOption(Team.Option option, Team.OptionStatus status)Set an option for this teamvoidsetPrefix(String prefix)Sets the prefix prepended to the display of entries on this team.voidsetSuffix(String suffix)Sets the suffix appended to the display of entries on this team.voidunregister()Unregisters this team from the Scoreboard
-
-
-
Method Detail
-
getName
@NotNull String getName() throws IllegalStateException
Gets the name of this Team- Returns:
- Objective name
- Throws:
IllegalStateException- if this team has been unregistered
-
getDisplayName
@NotNull String getDisplayName() throws IllegalStateException
Gets the name displayed to entries for this team- Returns:
- Team display name
- Throws:
IllegalStateException- if this team has been unregistered
-
setDisplayName
void setDisplayName(@NotNull String displayName) throws IllegalStateException, IllegalArgumentExceptionSets the name displayed to entries for this team- Parameters:
displayName- New display name- Throws:
IllegalArgumentException- if displayName is longer than 128 characters.IllegalStateException- if this team has been unregistered
-
getPrefix
@NotNull String getPrefix() throws IllegalStateException
Gets the prefix prepended to the display of entries on this team.- Returns:
- Team prefix
- Throws:
IllegalStateException- if this team has been unregistered
-
setPrefix
void setPrefix(@NotNull String prefix) throws IllegalStateException, IllegalArgumentExceptionSets the prefix prepended to the display of entries on this team.- Parameters:
prefix- New prefix- Throws:
IllegalArgumentException- if prefix is nullIllegalArgumentException- if prefix is longer than 64 charactersIllegalStateException- if this team has been unregistered
-
getSuffix
@NotNull String getSuffix() throws IllegalStateException
Gets the suffix appended to the display of entries on this team.- Returns:
- the team's current suffix
- Throws:
IllegalStateException- if this team has been unregistered
-
setSuffix
void setSuffix(@NotNull String suffix) throws IllegalStateException, IllegalArgumentExceptionSets the suffix appended to the display of entries on this team.- Parameters:
suffix- the new suffix for this team.- Throws:
IllegalArgumentException- if suffix is nullIllegalArgumentException- if suffix is longer than 64 charactersIllegalStateException- if this team has been unregistered
-
getColor
@NotNull ChatColor getColor() throws IllegalStateException
Gets the color of the team.
This only sets the team outline, other occurrences of colors such as in names are handled by prefixes / suffixes.- Returns:
- team color, defaults to
ChatColor.RESET - Throws:
IllegalStateException- if this team has been unregistered
-
setColor
void setColor(@NotNull ChatColor color)Sets the color of the team.
This only sets the team outline, other occurrences of colors such as in names are handled by prefixes / suffixes.- Parameters:
color- new color, must be non-null. UseChatColor.RESETfor no color
-
allowFriendlyFire
boolean allowFriendlyFire() throws IllegalStateExceptionGets the team friendly fire state- Returns:
- true if friendly fire is enabled
- Throws:
IllegalStateException- if this team has been unregistered
-
setAllowFriendlyFire
void setAllowFriendlyFire(boolean enabled) throws IllegalStateExceptionSets the team friendly fire state- Parameters:
enabled- true if friendly fire is to be allowed- Throws:
IllegalStateException- if this team has been unregistered
-
canSeeFriendlyInvisibles
boolean canSeeFriendlyInvisibles() throws IllegalStateExceptionGets the team's ability to seeinvisibleteammates.- Returns:
- true if team members can see invisible members
- Throws:
IllegalStateException- if this team has been unregistered
-
setCanSeeFriendlyInvisibles
void setCanSeeFriendlyInvisibles(boolean enabled) throws IllegalStateExceptionSets the team's ability to seeinvisibleteammates.- Parameters:
enabled- true if invisible teammates are to be visible- Throws:
IllegalStateException- if this team has been unregistered
-
getNameTagVisibility
@Deprecated @NotNull NameTagVisibility getNameTagVisibility() throws IllegalArgumentException
Deprecated.Gets the team's ability to see name tags- Returns:
- the current name tag visibility for the team
- Throws:
IllegalArgumentException- if this team has been unregistered
-
setNameTagVisibility
@Deprecated void setNameTagVisibility(@NotNull NameTagVisibility visibility) throws IllegalArgumentException
Deprecated.Set's the team's ability to see name tags- Parameters:
visibility- The nameTagVisibility to set- Throws:
IllegalArgumentException- if this team has been unregistered
-
getPlayers
@Deprecated @NotNull Set<OfflinePlayer> getPlayers() throws IllegalStateException
Deprecated.Teams can contain entries that aren't playersGets the Set of players on the team- Returns:
- players on the team
- Throws:
IllegalStateException- if this team has been unregistered\- See Also:
getEntries()
-
getEntries
@NotNull Set<String> getEntries() throws IllegalStateException
Gets the Set of entries on the team- Returns:
- entries on the team
- Throws:
IllegalStateException- if this entries has been unregistered\
-
getSize
int getSize() throws IllegalStateExceptionGets the size of the team- Returns:
- number of entries on the team
- Throws:
IllegalStateException- if this team has been unregistered
-
getScoreboard
@Nullable 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(@NotNull OfflinePlayer player) throws IllegalStateException, IllegalArgumentException
Deprecated.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:
IllegalArgumentException- if player is nullIllegalStateException- if this team has been unregistered- See Also:
addEntry(String)
-
addEntry
void addEntry(@NotNull String entry) throws IllegalStateException, 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:
IllegalArgumentException- if entry is nullIllegalStateException- if this team has been unregistered
-
removePlayer
@Deprecated boolean removePlayer(@NotNull OfflinePlayer player) throws IllegalStateException, IllegalArgumentException
Deprecated.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:
IllegalArgumentException- if player is nullIllegalStateException- if this team has been unregistered- See Also:
removeEntry(String)
-
removeEntry
boolean removeEntry(@NotNull String entry) throws IllegalStateException, IllegalArgumentExceptionRemoves the entry from this team.- Parameters:
entry- the entry to remove- Returns:
- if the entry was a part of this team
- Throws:
IllegalArgumentException- if entry is nullIllegalStateException- if this team has been unregistered
-
unregister
void unregister() throws IllegalStateExceptionUnregisters this team from the Scoreboard- Throws:
IllegalStateException- if this team has been unregistered
-
hasPlayer
@Deprecated boolean hasPlayer(@NotNull OfflinePlayer player) throws IllegalArgumentException, IllegalStateException
Deprecated.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:
IllegalArgumentException- if player is nullIllegalStateException- if this team has been unregistered- See Also:
hasEntry(String)
-
hasEntry
boolean hasEntry(@NotNull String entry) throws IllegalArgumentException, 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:
IllegalArgumentException- if entry is nullIllegalStateException- if this team has been unregistered
-
getOption
@NotNull Team.OptionStatus getOption(@NotNull Team.Option option) throws IllegalStateException
Get an option for this team- Parameters:
option- the option to get- Returns:
- the option status
- Throws:
IllegalStateException- if this team has been unregistered
-
setOption
void setOption(@NotNull Team.Option option, @NotNull Team.OptionStatus status) throws IllegalStateExceptionSet an option for this team- Parameters:
option- the option to setstatus- the new option status- Throws:
IllegalStateException- if this team has been unregistered
-
-