This feature is exclusive to Java Edition.
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.
- Lists all teams, with their display names and the amount of entities in them. The optional
team add <team> [<displayName>]
- Creates a team with the given name and optional display name.
<displayName>
defaults to<team>
when unspecified.
- Creates a team with the given name and optional display name.
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 is specified, makes the 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 a team name of an unquoted string. Allowed characters include:
-
,+
,.
,_
,A
-Z
,a
-z
, and0
-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
, and0
-9
).
<displayName>
: component
- Specifies the team name to be displayed.
- Must be a raw JSON text.
<members>
: score_holder
- Specifies the entities to join or leave the team.
- Must be a selection of score holders. It may be either a target selector, a player name, a UUID, or
*
for all score holders tracked by the scoreboard. Named player needn't be online, and it even needn't be a real player's name.
<option>
- A specific option to change.
- Value must be one of the following:
displayName
: Set the display name of the team.color
: Decide 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
: Enable/Disable players inflicting damage on 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
: Decide players can see invisible players on their team as whether semi-transparent or completely invisible.nametagVisibility
: Decide whose name tags above their heads can be seen.deathMessageVisibility
: Control the visibility of death messages for players.collisionRule
: Controls the way the entities on the team collide with other entities.prefix
: Modifies the prefix that displays before players' names.suffix
: Modifies the suffix that displays after players' names.
<value>
- Specifies the value to set
<option>
to. - Shown below are the values for each option.
- For
displayName
:<displayName>
: component - Specifies the team name to be displayed. Must be a raw JSON text.
- For
color
:<value>
: color - Must be a raw JSON text.- Defaults to
reset
. Ifreset
, names are shown in default color and formatting.
- Defaults to
- For
friendlyFire
:<allowed>
: boolean - Must be a raw JSON text.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 - Must be a raw JSON text.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
: - For
prefix
:<prefix>
: component - Specifies the prefix to display. Must be a raw JSON text.
- For
suffix
:<suffix>
: component - Specifies the suffix to display. Must be a raw JSON text.
- For
Result[]
Command | Trigger | Java Edition |
---|---|---|
any | the arguments are not specified correctly | Unparseable |
/team list <team> | <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 ... | the specified value is the same as current value | |
any | Otherwise | Successful |
Output[]
Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
---|---|---|---|---|---|
any | Java Edition | On fail | 0 | 0 | 0 |
/team list | On success | 1 | 1 | the number of existing teams | |
/team list <team> | On success | 1 | 1 | the number of members in the <team></team> | |
/team add ... | On success | 1 | 1 | the number of existing teams after execution | |
/team empty ... | On success | 1 | 1 | the number of members in the team before execution | |
/team join | On success | 1 | 1 | 1 | |
/team join <members> | On success | 1 | 1 | the number of specified entities | |
/team leave ... | On success | 1 | 1 | the number of specified entities | |
/team modify displayName ... | On success | 1 | 1 | 0 | |
/team modify prefix ... | On success | 1 | 1 | 1 |
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. | |||||
1.18 | 21w37a | Removed 16 characters limit for the name of a team, and 40 characters limit for the name of members. |
See also[]
/scoreboard
— manages scoreboard objectives, players and displays/tag
– tags players with a certain string