/team
< Commands
This feature is exclusive to Java Edition.
/team| Permission level required |
2 |
|---|---|
| Restrictions |
None |
{
"title": "<code>/team</code>",
"rows": [
{
"field": "2",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "None",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
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 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, 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.
- 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:<displayName>: component - Specifies the team name to be displayed. It must be a valid text component.
- For
color:<value>: color - It must be a valid text component.- Defaults to
reset. Ifreset, names are shown in default color and formatting.
- Defaults to
- 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:<prefix>: component - Specifies the prefix to display. It must be a valid text component.
- For
suffix:<suffix>: component - Specifies the suffix to display. It must be a valid text component.
- For
Result
| Command | Trigger | Java Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is 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 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. | |||||
| 1.21.5 | 25w05a | Text 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