Scoreboard



The scoreboard system is a complex gameplay mechanic utilized through commands. Mainly intended for mapmakers and server operators, scoreboards are used to track, set, and list the scores of players in a myriad of different ways.

Objectives
Objectives consist of three main arguments, in order: a name, a criterion, and a display name. Objectives track a number of points for players, and are displayed as integers with a full score range of -2,147,483,648 to 2,147,483,647.

An objective's name is used internally, for referencing in commands, target arguments, and in the file format. It is case-sensitive and must be a single word.

Conversely, the display name of an objective can be multiple words, and is displayed publicly in various situations. It is also case-sensitive, and does not have to be unique.

An objective's criterion determines its behavior, primarily what to track. A list of available criteria is provided below.

A player's score in any objective may be changed via commands, unless it is read-only. It may be increased or decreased by a specific amount, or set to a specific value. For objectives based upon statistics or achievements, the objective can be changed via commands; however, the actual stat or achievement does not change - the objective will continue to update with changes in stats or achievements.

Commands can also be used to check a player's score for any objective, with the arguments score_name and score_name_min. In these arguments, name is the internal name of the objective to test for. score_name passes players with at most the specified number of points, while score_name_min passes players with at least the specified number of points.

For example, inputting  into a command block will make a comparator or conditional command block provide output if a player has died at least once, and has died no more than 5 times, assuming "deaths" is an objective of the "deathCount" criterion.

Criteria
Some criteria use the Statistics and Achievements systems to form compound criteria. Unlike the simple criteria above, compound criteria have multiple parts, separated by periods ("."). For example, "stat.entityKilledBy.Zombie" would be a compound criterion, which would increment for a player whenever a zombie kills them.

A list of known compound criteria follows:

command (see command reference), players' scores in specific objectives can be displayed in certain 'slots' in-game. Each 'display slot' can show one objective at a time, and multiple 'display slots' may be used for the same or different objectives.

Tags
Scoreboard tags are a simple list of single-word strings stored directly in the Tags data tag of an entity. As with objectives, tags are case-sensitive.

Target selectors can be used to check whether an entity has a tag with the "tag" argument; the "!" character may be placed before a name to check for entities that do not have the tag. For example, inputting  into a command block will provide comparator output if a player is tagged with "banana". Similarly,  will provide output for players who are not tagged "banana".

To test for multiple tags, use the data tag "Tags". For example,  will check for a player that has both the "apple" and "banana" tags.

Teams
Teams are a combination of name, display name, prefix, suffix, friendly fire options, and a list of players who are on the team.

A team's name is used internally, for referencing in commands, target arguments, and in the file format. It is case-sensitive and must be a single word.

Conversely, the display name of a team can be multiple words, and is displayed publicly in various situations. It is also case-sensitive, and does not have to be unique.

A team's prefix and suffix are inserted before and after the names of players on the team, respectively. Without using external editors, the only possible prefixes are formatting codes for team colors, and the only possible suffix is the reset code (so characters after a player's name aren't formatted). Prefixes and suffixes will be added to the names of players in chat, the active players list, the sidebar, and above their heads. Without an in-game option, third-party software may be required to edit them.

The friendly fire option allows control of whether or not members of a team are able to harm each other. Its default mode, true, makes no changes to PvP mechanics - ergo, players can harm their teammates. When set to false, however, it prevents players on the same team from causing damage to each other with melee attacks, bows, and Splash Potions of Harming. Note that players on the same team may still inflict negative status effects on each other with potions, even if friendly fire is false.

It is important to note that each individual player can only be on one team; teams cannot share players.

Commands can be used to check whether a player is on a team with the "team" argument; the "!" character may be placed before a name to check for players not on the team. For example, inputting  into a command block will provide comparator output if a player is on the "red" team. Similarly,  will provide output for players who are not on "red". Also,  will check for all players on a team, while   will check for those without a team.

NBT format
The file scoreboard.dat in the 'data' folder of a Minecraft world stores the scoreboard data for that world as a GZip'd NBT file:


 * The root tag.
 * : The scoreboard data.
 * : A list of compound tags representing objectives.
 * An objective.
 * : The criteria of this objective.
 * : The display name of this objective. If none was specified during the objective's creation, this will be identical to the Name tag below.
 * : The internal name of this objective.
 * : The type of data to store. Defaults to "integer".
 * : A list of compound tags representing scores tracked by the scoreboard system.
 * A tracked player/objective pair with a score.
 * : The score this player has in this objective.
 * : The name of the player who has this score in this objective.
 * : The internal name of the objective which this player has this score in.
 * : 1 or 0 (true/false) - false if this objective is "enabled". Only meaningful for objectives with the criteria "trigger", where this must be false before a player can use the /trigger command on it.
 * : A list of compound tags representing teams.
 * A Team.
 * : 1 or 0 (true/false) - true if players on this team can harm each other.
 * : 1 or 0 (true/false) - true if players on this team can see invisible teammates.
 * : The value of the nametagVisibility option of this team.
 * : The value of the deathMessageVisibility option of this team. Valid options are: never, hideForOtherTeams, hideForOwnTeam, always
 * : The value of the collisionrule option of this team. Valid options are: always, pushOwnTeam, never, pushOtherTeams
 * : The display name of this team. If none was specified during the team's creation, this will be identical to the Name tag below.
 * : The internal name of this team.
 * : The prefix prepended to names of players on this team. Ordinarily, it is a Formatting Code.
 * : The suffix appended to names of players on this team. Ordinarily, it is the reset code, "§r", to prevent formatting from spilling over, but it may be blank if prefix is also blank.
 * : The text-based color ("black", "dark_blue", etc.) given to the team. Does not exist if no color is set.
 * : A list of names of players on this team.
 * The name of a player on this team.
 * : A set of slots which are displaying specific objectives. If a slot is empty, its tag is not present.
 * : The internal name of the objective displayed in the "list" slot.
 * : The internal name of the objective displayed in the "sidebar" slot.
 * : The internal name of the objective displayed in the "belowName" slot.
 * : The internal name of the objective displayed in the "sidebar.team.black" slot.
 * : The internal name of the objective displayed in the "sidebar.team.dark_blue" slot.
 * : The internal name of the objective displayed in the "sidebar.team.dark_green" slot.
 * : The internal name of the objective displayed in the "sidebar.team.dark_aqua" slot.
 * : The internal name of the objective displayed in the "sidebar.team.dark_red" slot.
 * : The internal name of the objective displayed in the "sidebar.team.dark_purple" slot.
 * : The internal name of the objective displayed in the "sidebar.team.gold" slot.
 * : The internal name of the objective displayed in the "sidebar.team.gray" slot.
 * : The internal name of the objective displayed in the "sidebar.team.dark_gray" slot.
 * : The internal name of the objective displayed in the "sidebar.team.blue" slot.
 * : The internal name of the objective displayed in the "sidebar.team.green" slot.
 * : The internal name of the objective displayed in the "sidebar.team.aqua" slot.
 * : The internal name of the objective displayed in the "sidebar.team.red" slot.
 * : The internal name of the objective displayed in the "sidebar.team.light_purple" slot.
 * : The internal name of the objective displayed in the "sidebar.team.yellow" slot.
 * : The internal name of the objective displayed in the "sidebar.team.white" slot.