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 Summary

Nested Classes
Modifier and Type
Interface
Description
`static enum`
`Team.Option`
Represents an option which may be applied to this team.
`static enum`
`Team.OptionStatus`
How an option may be applied to members of this team.

## Method Summary

Modifier and Type
Method
Description
`void`
`addEntry(@NotNull String entry)`
This puts the specified entry onto this team for the scoreboard.
`void`
`addPlayer(@NotNull 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.
`TextColor`
`color()`
Gets the color of the team.
`void`
`color(NamedTextColor color)`
Sets the color of the team.
`Component`
`displayName()`
Gets the name displayed to entries for this team
`void`
`displayName(Component displayName)`
Sets the name displayed to entries for this team
`@NotNull ChatColor`
`getColor()`
Deprecated.
in favour of `color()`
`@NotNull String`
`getDisplayName()`
Deprecated.
in favour of `displayName()`
`@NotNull Set<String>`
`getEntries()`
Gets the Set of entries on the team
`@NotNull String`
`getName()`
Gets the name of this Team
`@NotNull NameTagVisibility`
`getNameTagVisibility()`
Deprecated.
see `getOption(org.bukkit.scoreboard.Team.Option)`
`@NotNull Team.OptionStatus`
`getOption(@NotNull Team.Option option)`
Get an option for this team
`@NotNull Set<OfflinePlayer>`
`getPlayers()`
Deprecated.
Teams can contain entries that aren't players
`@NotNull String`
`getPrefix()`
Deprecated.
in favour of `prefix()`
`@Nullable Scoreboard`
`getScoreboard()`
Gets the Scoreboard to which this team is attached
`int`
`getSize()`
Gets the size of the team
`@NotNull String`
`getSuffix()`
Deprecated.
in favour of `suffix()`
`boolean`
`hasEntry(@NotNull String entry)`
Checks to see if the specified entry is a member of this team.
`boolean`
`hasPlayer(@NotNull OfflinePlayer player)`
Deprecated.
Teams can contain entries that aren't players
`Component`
`prefix()`
Gets the prefix prepended to the display of entries on this team.
`void`
`prefix(Component prefix)`
Sets the prefix prepended to the display of entries on this team.
`boolean`
`removeEntry(@NotNull String entry)`
Removes the entry from this team.
`boolean`
`removePlayer(@NotNull 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`
`setColor(@NotNull ChatColor color)`
Deprecated.
in favour of `color(net.kyori.adventure.text.format.NamedTextColor)`
`void`
`setDisplayName(@NotNull String displayName)`
Deprecated.
in favour of `displayName(net.kyori.adventure.text.Component)`
`void`
`setNameTagVisibility(@NotNull NameTagVisibility visibility)`
Deprecated.
see `setOption(org.bukkit.scoreboard.Team.Option, org.bukkit.scoreboard.Team.OptionStatus)`
`void`
`setOption(@NotNull Team.Option option, @NotNull Team.OptionStatus status)`
Set an option for this team
`void`
`setPrefix(@NotNull String prefix)`
Deprecated.
in favour of `prefix(net.kyori.adventure.text.Component)`
`void`
`setSuffix(@NotNull String suffix)`
Deprecated.
in favour of `suffix(net.kyori.adventure.text.Component)`
`Component`
`suffix()`
Gets the suffix appended to the display of entries on this team.
`void`
`suffix(Component suffix)`
Sets the suffix appended to the display of entries on this team.
`void`
`unregister()`
Unregisters this team from the Scoreboard

## Method Details

### getName

@NotNull @NotNull String getName() throws IllegalStateException
Gets the name of this Team

Returns:
  Objective name
Throws:
  `IllegalStateException` - if this team has been unregistered

### displayName

@NotNull Component displayName() throws IllegalStateException
Gets the name displayed to entries for this team

Returns:
  Team display name
Throws:
  `IllegalStateException` - if this team has been unregistered

### displayName

void displayName(@Nullable Component displayName) throws IllegalStateException, IllegalArgumentException
Sets 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

### prefix

@NotNull Component prefix() 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

### prefix

void prefix(@Nullable Component prefix) throws IllegalStateException, IllegalArgumentException
Sets the prefix prepended to the display of entries on this team.

Parameters:
  `prefix` - New prefix
Throws:
  `IllegalArgumentException` - if prefix is null characters
  `IllegalStateException` - if this team has been unregistered

### suffix

@NotNull Component suffix() 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

### suffix

void suffix(@Nullable Component suffix) throws IllegalStateException, IllegalArgumentException
Sets the suffix appended to the display of entries on this team.

Parameters:
  `suffix` - the new suffix for this team.
Throws:
  `IllegalArgumentException` - if suffix is null characters
  `IllegalStateException` - if this team has been unregistered

### color

@NotNull TextColor color() 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

### color

void color(@Nullable NamedTextColor 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. Use `ChatColor.RESET` for no color

### getDisplayName

@NotNull @Deprecated @NotNull String getDisplayName() throws IllegalStateException
Deprecated.
in favour of `displayName()`
Gets the name displayed to entries for this team

Returns:
  Team display name
Throws:
  `IllegalStateException` - if this team has been unregistered

### setDisplayName

@Deprecated void setDisplayName(@NotNull @NotNull String displayName) throws IllegalStateException, IllegalArgumentException
Deprecated.
in favour of `displayName(net.kyori.adventure.text.Component)`
Sets 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 @Deprecated @NotNull String getPrefix() throws IllegalStateException
Deprecated.
in favour of `prefix()`
Gets the prefix prepended to the display of entries on this team.

Returns:
  Team prefix
Throws:
  `IllegalStateException` - if this team has been unregistered

### setPrefix

@Deprecated void setPrefix(@NotNull @NotNull String prefix) throws IllegalStateException, IllegalArgumentException
Deprecated.
in favour of `prefix(net.kyori.adventure.text.Component)`
Sets the prefix prepended to the display of entries on this team.

Parameters:
  `prefix` - New prefix
Throws:
  `IllegalArgumentException` - if prefix is null
  `IllegalArgumentException` - if prefix is longer than 64 characters
  `IllegalStateException` - if this team has been unregistered

### getSuffix

@NotNull @Deprecated @NotNull String getSuffix() throws IllegalStateException
Deprecated.
in favour of `suffix()`
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

@Deprecated void setSuffix(@NotNull @NotNull String suffix) throws IllegalStateException, IllegalArgumentException
Deprecated.
in favour of `suffix(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:
  `IllegalArgumentException` - if suffix is null
  `IllegalArgumentException` - if suffix is longer than 64 characters
  `IllegalStateException` - if this team has been unregistered

### getColor

@NotNull @Deprecated @NotNull ChatColor getColor() throws IllegalStateException
Deprecated.
in favour of `color()`
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

@Deprecated void setColor(@NotNull @NotNull ChatColor color)
Deprecated.
in favour of `color(net.kyori.adventure.text.format.NamedTextColor)`
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.RESET` for no color

### allowFriendlyFire

boolean allowFriendlyFire() throws IllegalStateException
Gets 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 IllegalStateException
Sets 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 IllegalStateException
Gets the team's ability to see `invisible` teammates.

Returns:
  true if team members can see invisible members
Throws:
  `IllegalStateException` - if this team has been unregistered

### setCanSeeFriendlyInvisibles

void setCanSeeFriendlyInvisibles(boolean enabled) throws IllegalStateException
Sets the team's ability to see `invisible` teammates.

Parameters:
  `enabled` - true if invisible teammates are to be visible
Throws:
  `IllegalStateException` - if this team has been unregistered

### getNameTagVisibility

@Deprecated @NotNull @NotNull NameTagVisibility getNameTagVisibility() throws IllegalArgumentException
Deprecated.
see `getOption(org.bukkit.scoreboard.Team.Option)`
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 @NotNull NameTagVisibility visibility) throws IllegalArgumentException
Deprecated.
see `setOption(org.bukkit.scoreboard.Team.Option, org.bukkit.scoreboard.Team.OptionStatus)`
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 @NotNull Set<OfflinePlayer> getPlayers() throws IllegalStateException
Deprecated.
Teams can contain entries that aren't players
Gets 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 @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 IllegalStateException
Gets the size of the team

Returns:
  number of entries on the team
Throws:
  `IllegalStateException` - if this team has been unregistered

### getScoreboard

@Nullable @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 @NotNull OfflinePlayer player) throws IllegalStateException, 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:
  `IllegalArgumentException` - if player is null
  `IllegalStateException` - if this team has been unregistered
See Also:
  - `addEntry(String)`

### addEntry

void addEntry(@NotNull @NotNull String entry) throws IllegalStateException, 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:
  `IllegalArgumentException` - if entry is null
  `IllegalStateException` - if this team has been unregistered

### removePlayer

@Deprecated boolean removePlayer(@NotNull @NotNull OfflinePlayer player) throws IllegalStateException, 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:
  `IllegalArgumentException` - if player is null
  `IllegalStateException` - if this team has been unregistered
See Also:
  - `removeEntry(String)`

### removeEntry

boolean removeEntry(@NotNull @NotNull String entry) throws IllegalStateException, IllegalArgumentException
Removes 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 null
  `IllegalStateException` - if this team has been unregistered

### unregister

void unregister() throws IllegalStateException
Unregisters this team from the Scoreboard

Throws:
  `IllegalStateException` - if this team has been unregistered

### hasPlayer

@Deprecated boolean hasPlayer(@NotNull @NotNull OfflinePlayer player) throws IllegalArgumentException, 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:
  `IllegalArgumentException` - if player is null
  `IllegalStateException` - if this team has been unregistered
See Also:
  - `hasEntry(String)`

### hasEntry

boolean hasEntry(@NotNull @NotNull String entry) throws IllegalArgumentException, 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:
  `IllegalArgumentException` - if entry is null
  `IllegalStateException` - if this team has been unregistered

### getOption

@NotNull @NotNull Team.OptionStatus getOption(@NotNull @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 @NotNull Team.Option option, @NotNull @NotNull Team.OptionStatus status) throws IllegalStateException
Set an option for this team

Parameters:
  `option` - the option to set
  `status` - the new option status
Throws:
  `IllegalStateException` - if this team has been unregistered