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.- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic enumRepresents an option which may be applied to this team.static enumHow an option may be applied to members of this team.
- 
Method SummaryModifier and TypeMethodDescriptiondefault voidaddEntities(@NotNull Entity @NotNull ... entities) This puts a collection of entities onto this team for the scoreboard which results in one packet for the updates rather than a packet-per-entity.voidaddEntities(Collection<Entity> entities) This puts a collection of entities onto this team for the scoreboard which results in one packet for the updates rather than a packet-per-entity.voidThis puts the specified entity onto this team for the scoreboard.default voidaddEntries(@NotNull String... entries) This puts a collection of entries onto this team for the scoreboard which results in one packet for the updates rather than a packet-per-entry.voidaddEntries(Collection<String> entries) This puts a collection of entries onto this team for the scoreboard which results in one packet for the updates rather than a packet-per-entry.voidThis puts the specified entry onto this team for the scoreboard.voidaddPlayer(@NotNull OfflinePlayer player) This puts the specified player onto this team for the scoreboard.booleanGets the team friendly fire statebooleanGets the team's ability to seeinvisibleteammates.color()Gets the color of the team.voidcolor(@Nullable NamedTextColor color) Sets the color of the team.Gets the display name for this teamvoiddisplayName(@Nullable Component displayName) Sets the name displayed to entries for this teamgetColor()Deprecated.Deprecated.in favour ofdisplayName()Gets the Set of entries on the teamgetName()Gets the name of this TeamDeprecated.getOption(@NotNull Team.Option option) Get an option for this teamDeprecated.Teams can contain entries that aren't playersDeprecated.in favour ofprefix()Gets the Scoreboard to which this team is attachedintgetSize()Gets the size of the teamDeprecated.in favour ofsuffix()booleanhasColor()Checks if the team has a color specifiedbooleanChecks to see if the specified entity is a member of this team.booleanChecks to see if the specified entry is a member of this team.booleanhasPlayer(@NotNull OfflinePlayer player) Checks to see if the specified player is a member of this team.prefix()Gets the prefix prepended to the display of entries on this team.voidSets the prefix prepended to the display of entries on this team.default booleanremoveEntities(@NotNull Entity @NotNull ... entities) Removes a collection of entities from this team which results in one packet for the updates rather than a packet-per-entity.booleanremoveEntities(Collection<Entity> entities) Removes a collection of entities from this team which results in one packet for the updates rather than a packet-per-entity.booleanremoveEntity(Entity entity) Removes the entity from this team.default booleanremoveEntries(@NotNull String... entries) Removes a collection of entries from this team which results in one packet for the updates rather than a packet-per-entry.booleanremoveEntries(Collection<String> entries) Removes a collection of entries from this team which results in one packet for the updates rather than a packet-per-entry.booleanremoveEntry(@NotNull String entry) Removes the entry from this team.booleanremovePlayer(@NotNull OfflinePlayer player) Removes the player from this team.voidsetAllowFriendlyFire(boolean enabled) Sets the team friendly fire statevoidsetCanSeeFriendlyInvisibles(boolean enabled) Sets the team's ability to seeinvisibleteammates.voidDeprecated.voidsetDisplayName(@NotNull String displayName) Deprecated.in favour ofdisplayName(net.kyori.adventure.text.Component)voidsetNameTagVisibility(@NotNull NameTagVisibility visibility) Deprecated.voidsetOption(@NotNull Team.Option option, @NotNull Team.OptionStatus status) Set an option for this teamvoidDeprecated.in favour ofprefix(net.kyori.adventure.text.Component)voidDeprecated.in favour ofsuffix(net.kyori.adventure.text.Component)suffix()Gets the suffix appended to the display of entries on this team.voidSets the suffix appended to the display of entries on this team.voidUnregisters this team from the Scoreboard
- 
Method Details- 
getNameGets the name of this Team- Returns:
- Objective name
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
displayNameGets the display name for this team- Returns:
- Team display name
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
displayNameSets the name displayed to entries for this team- Parameters:
- displayName- New display name
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
prefixGets the prefix prepended to the display of entries on this team.- Returns:
- Team prefix
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
prefixSets the prefix prepended to the display of entries on this team.- Parameters:
- prefix- New prefix
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
suffixGets 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
 
- 
suffixSets the suffix appended to the display of entries on this team.- Parameters:
- suffix- the new suffix for this team.
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
hasColorboolean hasColor()Checks if the team has a color specified- Returns:
- true if it has a color
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
colorGets 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
- Throws:
- IllegalStateException- if this team has been unregistered
- IllegalStateException- if the team doesn't have a color
- See Also:
 
- 
colorSets 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, null for no color
 
- 
getDisplayNameDeprecated.in favour ofdisplayName()Gets the name displayed to entries for this team- Returns:
- Team display name
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
setDisplayNameDeprecated.in favour ofdisplayName(net.kyori.adventure.text.Component)Sets the name displayed to entries for this team- Parameters:
- displayName- New display name
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
getPrefixDeprecated.in favour ofprefix()Gets the prefix prepended to the display of entries on this team.- Returns:
- Team prefix
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
setPrefixDeprecated.in favour ofprefix(net.kyori.adventure.text.Component)Sets the prefix prepended to the display of entries on this team.- Parameters:
- prefix- New prefix
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
getSuffixDeprecated.in favour ofsuffix()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
 
- 
setSuffixDeprecated.in favour ofsuffix(net.kyori.adventure.text.Component)Sets the suffix appended to the display of entries on this team.- Parameters:
- suffix- the new suffix for this team.
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
getColorDeprecated.in favour ofcolor()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
 
- 
setColorDeprecated.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. Use- ChatColor.RESETfor no color
 
- 
allowFriendlyFireboolean allowFriendlyFire()Gets the team friendly fire state- Returns:
- true if friendly fire is enabled
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
setAllowFriendlyFirevoid setAllowFriendlyFire(boolean enabled) Sets the team friendly fire state- Parameters:
- enabled- true if friendly fire is to be allowed
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
canSeeFriendlyInvisiblesboolean canSeeFriendlyInvisibles()Gets the team's ability to seeinvisibleteammates.- Returns:
- true if team members can see invisible members
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
setCanSeeFriendlyInvisiblesvoid setCanSeeFriendlyInvisibles(boolean enabled) Sets the team's ability to seeinvisibleteammates.- Parameters:
- enabled- true if invisible teammates are to be visible
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
getNameTagVisibilityDeprecated.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
 
- 
setNameTagVisibilityDeprecated.Set's the team's ability to see name tags- Parameters:
- visibility- The nameTagVisibility to set
- Throws:
- IllegalArgumentException- if this team has been unregistered
 
- 
getPlayersDeprecated.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:
 
- 
getEntriesGets the Set of entries on the team- Returns:
- entries on the team
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
getSizeint getSize()Gets the size of the team- Returns:
- number of entries on the team
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
getScoreboardGets the Scoreboard to which this team is attached- Returns:
- Owning scoreboard, or null if this team has been unregistered
 
- 
addPlayerThis 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:
- IllegalStateException- if this team has been unregistered
- See Also:
 
- 
addEntryThis 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:
- IllegalStateException- if this team has been unregistered
 
- 
addEntitiesThis puts a collection of entities onto this team for the scoreboard which results in one packet for the updates rather than a packet-per-entity.Entities on other teams will be removed from their respective teams. - Parameters:
- entities- the entities to add
- Throws:
- IllegalArgumentException- if entities are null
- IllegalStateException- if this team has been unregistered
 
- 
addEntitiesvoid addEntities(@NotNull Collection<Entity> entities) throws IllegalStateException, IllegalArgumentException This puts a collection of entities onto this team for the scoreboard which results in one packet for the updates rather than a packet-per-entity.Entities on other teams will be removed from their respective teams. - Parameters:
- entities- the entities to add
- Throws:
- IllegalArgumentException- if entities are null
- IllegalStateException- if this team has been unregistered
 
- 
addEntriesdefault void addEntries(@NotNull @NotNull String... entries) throws IllegalStateException, IllegalArgumentException This puts a collection of entries onto this team for the scoreboard which results in one packet for the updates rather than a packet-per-entry.Entries on other teams will be removed from their respective teams. - Parameters:
- entries- the entries to add
- Throws:
- IllegalArgumentException- if entries are null
- IllegalStateException- if this team has been unregistered
 
- 
addEntriesvoid addEntries(@NotNull Collection<String> entries) throws IllegalStateException, IllegalArgumentException This puts a collection of entries onto this team for the scoreboard which results in one packet for the updates rather than a packet-per-entry.Entries on other teams will be removed from their respective teams. - Parameters:
- entries- the entries to add
- Throws:
- IllegalArgumentException- if entries are null
- IllegalStateException- if this team has been unregistered
 
- 
removePlayerRemoves the player from this team.- Parameters:
- player- the player to remove
- Returns:
- if the player was on this team
- Throws:
- IllegalStateException- if this team has been unregistered
- See Also:
 
- 
removeEntryRemoves the entry from this team.- Parameters:
- entry- the entry to remove
- Returns:
- if the entry was a part of this team
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
removeEntitiesdefault boolean removeEntities(@NotNull @NotNull Entity @NotNull ... entities) throws IllegalStateException, IllegalArgumentException Removes a collection of entities from this team which results in one packet for the updates rather than a packet-per-entity.- Parameters:
- entities- the entries to remove
- Returns:
- if any of the entities were a part of this team
- Throws:
- IllegalArgumentException- if entities is null
- IllegalStateException- if this team has been unregistered
 
- 
removeEntitiesboolean removeEntities(@NotNull Collection<Entity> entities) throws IllegalStateException, IllegalArgumentException Removes a collection of entities from this team which results in one packet for the updates rather than a packet-per-entity.- Parameters:
- entities- the entries to remove
- Returns:
- if any of the entities were a part of this team
- Throws:
- IllegalArgumentException- if entities is null
- IllegalStateException- if this team has been unregistered
 
- 
removeEntriesdefault boolean removeEntries(@NotNull @NotNull String... entries) throws IllegalStateException, IllegalArgumentException Removes a collection of entries from this team which results in one packet for the updates rather than a packet-per-entry.- Parameters:
- entries- the entries to remove
- Returns:
- if any of the entries were a part of this team
- Throws:
- IllegalArgumentException- if entries is null
- IllegalStateException- if this team has been unregistered
 
- 
removeEntriesboolean removeEntries(@NotNull Collection<String> entries) throws IllegalStateException, IllegalArgumentException Removes a collection of entries from this team which results in one packet for the updates rather than a packet-per-entry.- Parameters:
- entries- the entries to remove
- Returns:
- if any of the entries were a part of this team
- Throws:
- IllegalArgumentException- if entries is null
- IllegalStateException- if this team has been unregistered
 
- 
unregistervoid unregister()Unregisters this team from the Scoreboard- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
hasPlayerChecks 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:
- IllegalStateException- if this team has been unregistered
- See Also:
 
- 
hasEntryChecks 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:
- IllegalStateException- if this team has been unregistered
 
- 
getOptionGet an option for this team- Parameters:
- option- the option to get
- Returns:
- the option status
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
setOptionSet an option for this team- Parameters:
- option- the option to set
- status- the new option status
- Throws:
- IllegalStateException- if this team has been unregistered
 
- 
addEntityThis puts the specified entity onto this team for the scoreboard.This will remove the entity from any other team on the scoreboard. - Parameters:
- entity- the entity to add
- Throws:
- IllegalArgumentException- if entity is null
- IllegalStateException- if this team has been unregistered
- See Also:
 
- 
removeEntityRemoves the entity from this team.- Parameters:
- entity- the entity to remove
- Returns:
- if the entity was on this team
- Throws:
- IllegalArgumentException- if entity is null
- IllegalStateException- if this team has been unregistered
- See Also:
 
- 
hasEntityChecks to see if the specified entity is a member of this team.- Parameters:
- entity- the entity to search for
- Returns:
- true if the entity is a member of this team
- Throws:
- IllegalArgumentException- if entity is null
- IllegalStateException- if this team has been unregistered
- See Also:
 
 
- 
color()