/team

This feature is exclusive to Java Edition.
 
/team
Permission level
required

2

Restrictions

None

Controls teams.

Syntax

team list [<team>]
Lists all teams, with their display names and the amount of entities in them. The optional <team> can be used to specify a particular team.
team add <team> [<displayName>]
Creates a team with the given name and optional display name. <displayName> defaults to <team> when unspecified.
team remove <team>
Deletes the specified team.
team empty <team>
Removes all members from the named team.
team join <team> [<members>]
Assigns the specified entities to the specified team. If no entities are specified, makes the command executor join the team.
team leave <members>
Makes the specified entities leave their teams.
team modify <team> <option> <value>
Modifies the options of the specified team.

Arguments

<team>: team (in list, remove, empty, join, and modify mode)

Specifies the name of a team.
Must be an unquoted string, which resolves into a during command execution. Allowed characters include: -, +, ., _, A-Z, a-z, and 0-9.

<team>: string (in add mode)

Specifies the name for a new team.
Must be a string. And it must be in a single word (Allowed characters include: -, +, ., _, A-Z, a-z, and 0-9).

<displayName>: component

Specifies the team name to be displayed.
It must be a valid text component.

<members>: score_holder

Specifies the entities to join or leave the team.
It must be either a target selector, a player name, a UUID, or * for all score holders being tracked by the scoreboard system. Player names don't need to be of a player that is online or a player that exists and can use almost all unicode characters​.

<option>

A specific option to change.
Must be one of the following:
  • displayName: Sets the display name of the team.
  • color: Decides the color of the team and players in chat, above their head, on the Tab menu, and on the sidebar. Also changes the color of the outline of the entities caused by the Glowing effect.
  • friendlyFire: Enables/Disables players inflicting damage to each other when on the same team. (Note: players can still inflict status effects on each other.) Does not affect some non-player entities in a team.
  • seeFriendlyInvisibles: Decides whether invisible players are semi-transparent or completely invisible to other players on their team.
  • nametagVisibility: Decides whose name tags above their heads can be seen.
  • deathMessageVisibility: Controls the visibility of death messages for players.
  • collisionRule: Controls the way entities on the team collide with other entities.
  • prefix: Modifies the prefix that displays at the beginning of players' names.
  • suffix: Modifies the suffix that displays at the end of players' names.

<value>

Specifies the value to set <option> to.
Shown below are valid values for each option.
  • For displayName:
  • For color:
    • <value>: color - It must be a valid text component.
      • Defaults to reset. If reset, names are shown in default color and formatting.
  • For friendlyFire:
    • <allowed>: boolean - It must be a valid text component.
      • true - (Default) Enable players inflicting damage on each other when in the same team.
      • false - Disable players inflicting damage on each other when in the same team.
  • For seeFriendlyInvisibles:
    • <allowed>: boolean - It must be a valid text component.
      • true - (Default) Can see invisible players on the same team semi-transparently.
      • false - Cannot see invisible players on the same team.
  • For nametagVisibility:
    • never - Name above player's head cannot be seen by any players.
    • hideForOtherTeams - Name above player's head can be seen only by players in the same team.
    • hideForOwnTeam - Name above player's head cannot be seen by all the players in the same team.
    • always - (Default) Name above player's head can be seen by all the players.
  • For deathMessageVisibility:
    • never - Hide death message for all the players.
    • hideForOtherTeams - Hide death message to all the players who are not in the same team.
    • hideForOwnTeam - Hide death message to players in the same team.
    • always - (Default) Make death message visible to all the players.
  • For collisionRule:
    • always - (Default) Normal collision.
    • never - No entities can push the entities in this team.
    • pushOtherTeams - Entities in this team can be pushed only by other entities in the same team. (Contrary to the literal meaning.[1])
    • pushOwnTeam - Entities in this team cannot be pushed by another entity in this team. (Contrary to the literal meaning.[1])
  • For prefix:
  • For suffix:

Result

CommandTriggerJava Edition
AnyThe command is incomplete, or any argument is not specified correctly. Unparseable
/team list <team>
/team remove ...
/team empty ...
/team join ...
/team modify ...
<team> doesn't exist. Failed
/team add ...The named <team> already exists.
/team empty ...The <team> is already empty.
/team join ...<members> is not specified when the command's executor is not an entity.
<members> fails to resolve to one or more entities.
/team leave ...<members> fails to resolve to one or more entities. Failed
/team modify displayName ...
/team modify color ...
/team modify friendlyFire ...
/team modify seeFriendlyInvisibles ...
/team modify nametagVisibility ...
/team modify deathMessageVisibility ...
/team modify collisionRule ...
The specified value is the same as current value.
AnyOtherwiseSuccessful

Output

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
AnyJava EditionOn fail000
/team listOn success11the number of existing teams
/team list <team>On success11the number of members in the <team>
/team add ...
/team remove ...
On success11the number of existing teams after execution
/team empty ...On success11the number of members in the team before execution
/team joinOn success111
/team join <members>On success11the number of specified entities
/team leave ...On success11the number of specified entities
/team modify displayName ...
/team modify color ...
/team modify friendlyFire ...
/team modify seeFriendlyInvisibles ...
/team modify nametagVisibility ...
/team modify deathMessageVisibility ...
/team modify collisionRule ...
On success110
/team modify prefix ...
/team modify suffix ...
On success111

History

Java Edition
1.1317w45aAdded /team.
18w20aAdded /team option <team> prefix <prefix>.
Added /team option <team> suffix <suffix>.
pre8/team option is now /team modify
Added /team modify <teamName> displayName.
Team names are now text components, not raw strings.
1.1821w37aRemoved 16 characters limit for the name of a team, and 40 characters limit for the name of members.
1.21.525w05aText component arguments are now resolved before use in context of entity held in @s.

See also

  • /scoreboard – manages scoreboard objectives, players and displays
  • /tag – tags players with a certain string

References

  1. a b MC-87984

Navigation