Commands/infobox
This feature is exclusive to Java Edition.
Controls teams.
Syntax
team add <team> [<displayName>]team empty <team>team join <team> [<members>]team leave <members>team list [<team>]team modify <team> <option> <value>team remove <team>
Arguments
<team>
- Specifies the name of the team.
<displayName>
- Specifies the team name to be displayed. Must be a plain text or a valid raw JSON text.
<members>
- Specifies the entities to join or leave the team. Must be a player name, a target selector, or a UUID.
- Permits entities other than players.
<option>
- A specific option to change.
- Value must be one of the following:
collisionRule: Decide what entities entities on this team can push.color: Decide the color of the team and players in chat.deathMessageVisibility: Decide whose death messages can be seen in chat.displayName: Set the display name of the team.friendlyFire: Enable/Disable players inflicting damage on each other when on the same team. (Note: players can still inflict status effects on each other.)nametagVisibility: Decide whose name tags above their heads can be seen.prefix: Modifies the prefix that appears before players' names in chat.seeFriendlyInvisibles: Decide if players can see invisible players on their team as semi-transparent or completely invisible.suffix: Modifies the suffix that appears after players' names in chat.
<value>
- Specifies the value to set
<option>to. - Shown below are the values for each option.
- For
collisionRule:always- (Default) Normal collision.never- No entities can push entities on this team.pushOtherTeams- Entities on this team can be pushed only by another entity on this team.pushOwnTeam- Entities on this team cannot be pushed by another entity on this team.
- For
color:aquablackbluedark_aquadark_bluedark_graydark_greendark_purpledark_redgoldgraygreenlight_purpleredreset- (Default) reset the color.yellowwhite
- For
deathMessageVisibility:never- Hide deathmessage for every players.hideForOtherTeams- Hide deathmessage to every players who are not on the same team.hideForOwnTeam- Hide deathmessage to players on the same team.always- (Default) Make deathmessage visible to every players.
- For
displayName:<displayName>- Specifies the team name to be displayed. Must be a plain text or a valid raw JSON text.
- For
friendlyFiretrue- (Default) Enable players inflicting damage on each other when on the same team.false- Disable players inflicting damage on each other when 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 on the same team.hideForOwnTeam- Name above player's head cannot be seen by any players on the same team.always- (Default) Name above player's head can be seen by any players.
- For
prefix:<prefix>- Specifies the prefix. Must be a plain text or a valid raw JSON text.
- For
seeFriendlyInvisibles:true- (Default) Can see invisible players on the same team.false- Cannot see invisible players on the same team.
- For
suffix:<suffix>- Specifies the suffix. Must be a plain text or a valid raw JSON text.
- For
Result
Fails if the arguments are not specified correctly.
add— Fails if the team already exists. On success, creates a new team.empty— Fails if the team does not exist or is already empty. On success, removes all members from a team.join— Fails if the team does not exist or if<members>fails to resolve to one or more online players or entities. On success, makes<members>join a team.leave— Fails if<members>fails to resolve to one or more online players or entities. On success, makes a player leave a team.list— Always succeeds. Lists all teams, or lists all members of a team if team is set.modify— Fails if the team does not exist or if the specified value is the same as the current value. On success, sets the<option>of a team to the specified value.remove— Fails if the team does not exist. On success, Removes the team.
History
| Java Edition | |||||
|---|---|---|---|---|---|
| 1.13 | 17w45a | Added /team. | |||
| 18w20a | Added /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. | |||||
See also
/scoreboard— manages scoreboard objectives, players and teams/tag– tags players with a certain string