Skip to main content

Team (Entity Action Type)

Joins, leaves, creates, edits, empties or deletes a scoreboard team. It is the data pack equivalent of the /team command.

Type ID: apoli:team

Type aliases: apoli:join_team (sets "operation": "join"), apoli:leave_team ("leave") and apoli:modify_team ("modify").

Fields

FieldTypeDefaultDescription
operationStringjoinWhat to do. See Operations.
teamTeamoptionalWhich team, and which properties to set. Leave it out to use the entity's current team.
create_if_missingBooleantrueFor join and create, makes the team if it doesn't exist yet.

Operations

OperationEffect
joinAdds the entity to the team. Any properties on team are applied to the team first.
leaveRemoves the entity from whatever team it is on.
createMakes the team (if it is missing) and applies the properties, without joining it.
modifyApplies the properties to an existing team. Does nothing if the team doesn't exist.
emptyRemoves every member from the team.
deleteDeletes the team entirely.

Examples

Join a team, creating it with the right settings on first use:

{
  "type": "apoli:team",
  "operation": "join",
  "team": {
    "name": "vampires",
    "friendly_fire": false,
    "see_friendly_invisibles": true,
    "color": "dark_red"
  }
}

Leave when the power is lost:

{ "type": "apoli:leave_team" }

Turn off friendly fire on the team the holder is already on:

{
  "type": "apoli:modify_team",
  "team": { "friendly_fire": false }
}
warning

Teams are server state that everyone shares. delete and empty affect all members, including entities other than the one running the action.