Skip to main content
Teams group players and entities under shared visual properties. By assigning players or entities to a team, you can control how their names appear in chat, whether they can damage each other, how their name tags display to other players, and what collision rules apply between them. Teams are managed through your Scoreboard instance.

Creating and retrieving teams

Use scoreboard.team(String name) to create a team or retrieve an existing one by the same name. This is the primary way to work with teams — it is safe to call repeatedly with the same name.
If you only want to retrieve a team that already exists without creating one, use getTeam(String name). It returns null if no team with that name exists:
To check whether a team exists before acting on it:
To find which team a player belongs to:

Team properties

Once you have a Team reference, you can configure its visual and gameplay properties. All setter methods return the Team instance, so you can chain them. TeamColor values: BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, GOLD, GRAY, DARK_GRAY, BLUE, GREEN, AQUA, RED, LIGHT_PURPLE, YELLOW, WHITE TeamCollisionRule values: NEVER, FOR_OWN_TEAM, FOR_OTHER_TEAMS, ALWAYS TeamNameTagVisibility values: NEVER, FOR_OWN_TEAM, FOR_OTHER_TEAMS, ALWAYS

Members

Add or remove players and entities from a team using the following methods:

Fluent API

All Team setter methods return the Team instance, so you can chain configuration into a single expression. This is the recommended way to set up a team.
You can continue to call setter methods on the team later — for example, to update the prefix when a player’s rank changes:
To remove a team entirely, call removeTeam(String name) on the scoreboard. To remove all teams at once, use clearTeams():