Scoreboard instance.
Creating and retrieving teams
Usescoreboard.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.
getTeam(String name). It returns null if no team with that name exists:
Team properties
Once you have aTeam reference, you can configure its visual and gameplay properties. All setter methods return the Team instance, so you can chain them.
| Property | Method | Description |
|---|---|---|
| Color | setColor(TeamColor) | Sets the team color used for name display. Choose from 16 TeamColor values. |
| Prefix | setPrefix(String) | Text prepended to each member’s name in chat and above their head. |
| Suffix | setSuffix(String) | Text appended to each member’s name in chat and above their head. |
| Friendly fire | setFriendlyFire(boolean) | Controls whether teammates can damage each other. |
| Friendly invisibilities | setCanSeeFriendlyInvisibilities(boolean) | Controls whether invisible teammates are visible to other team members. |
| Collision rule | setTeamCollisionRule(TeamCollisionRule) | Sets entity collision behavior: NEVER, FOR_OWN_TEAM, FOR_OTHER_TEAMS, or ALWAYS. |
| Name tag visibility | setNameTagVisibility(TeamNameTagVisibility) | Controls who can see member name tags: NEVER, FOR_OWN_TEAM, FOR_OTHER_TEAMS, or ALWAYS. |
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:| Method | Description |
|---|---|
addPlayer(Player) | Adds a player to the team. |
addEntity(Entity) | Adds a non-player entity to the team. |
removePlayer(Player) | Removes a player from the team. |
removeEntity(Entity) | Removes an entity from the team. |
hasPlayer(Player) | Returns true if the player is on this team. |
hasEntity(Entity) | Returns true if the entity is on this team. |
Fluent API
AllTeam 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.
removeTeam(String name) on the scoreboard. To remove all teams at once, use clearTeams():