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 entities in a myriad of different ways.

Objectives
Objectives each have three main variables: A name, a criterion, and a display name. Objectives track a number of points for entities, and are stored and 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 the file format. $$, the allowed character set for it includes all lowercase and uppercase letters, numbers, underscore, period, minus and plus. $$, it can contain any character.

An objective's display name is a raw JSON text and is displayed publicly in various situations. It does not have to be unique.

An objective's criterion determines its behavior&mdash;primarily what to track. Lists of valid criteria are provided below.

An entity's score in any objective can be changed via commands unless it's read-only (see ). It can be increased by, decreased by, or set to a given amount with commands.

A score holder is a player's name or an entity's UUID that has scores in an objective. Player name doesn’t need to be a real one. Scores of non-player entities can be changed only by commands, and not by game system. Unlike players, when a non player entity dies, its scores are deleted.

Commands can check entity scores by using target selector with the  argument (syntaxed  . This argument uses to specify the internal name of the tested-for objective.


 * For example, $$, inputting into a command block triggers a comparator or conditional command block if any player has died at least once, assuming "deaths" is an objective of the "deathCount" criterion.

Single criteria

 * These criteria's names consist of a single alphabetical string.


 * {| class="wikitable" style="width:100%" data-description="Criteria"

! Criterion name ! Description ! Can be modified
 * dummy
 * Score is only changed by commands, and not by game events such as death. This is useful for event flags, state mappings, currencies,...
 * trigger
 * Score is only changed by commands, and not by game events such as death. The command can be used by a player to set or increment/decrement their own score in an objective with this criterion. The  command fails if the objective has not been "enabled" for the player using it, and the objective is disabled for the player after using the  command on it. Note that the  command can be used by ordinary players even if Cheats are off and they are not an Operator. This is useful for player input via  interfaces.
 * deathCount
 * Score increments automatically for a player when they die.
 * playerKillCount
 * Score increments automatically for a player when they kill another player.
 * totalKillCount
 * Score increments automatically for a player when they kill another player or a mob.
 * health
 * Ranges from 0 to 20 on a normal player; represents the amount of half-hearts the player has. May appear as 0 for players before their health has changed for the first time. Extra hearts and absorption hearts also count to the health score, meaning that with Attributes/Modifiers or the Health Boost or Absorption status effects, health can far surpass 20.
 * xp
 * Matches the total amount of experience the player has collected since their last death (or in other words, their score).
 * level
 * Matches the current experience level of the player.
 * food
 * Ranges from 0 to 20; represents the amount of hunger points the player has. May appear as 0 for players before their foodLevel has changed for the first time.
 * air
 * Ranges from 0 to 300; represents the amount of air the player has left from swimming under water, matches the air nbt tag of the player.
 * armor
 * Ranges from 0 to 20; represents the amount of armor points the player has. May appear as 0 for players before their armor has changed for the first time.
 * }
 * xp
 * Matches the total amount of experience the player has collected since their last death (or in other words, their score).
 * level
 * Matches the current experience level of the player.
 * food
 * Ranges from 0 to 20; represents the amount of hunger points the player has. May appear as 0 for players before their foodLevel has changed for the first time.
 * air
 * Ranges from 0 to 300; represents the amount of air the player has left from swimming under water, matches the air nbt tag of the player.
 * armor
 * Ranges from 0 to 20; represents the amount of armor points the player has. May appear as 0 for players before their armor has changed for the first time.
 * }
 * Ranges from 0 to 20; represents the amount of hunger points the player has. May appear as 0 for players before their foodLevel has changed for the first time.
 * air
 * Ranges from 0 to 300; represents the amount of air the player has left from swimming under water, matches the air nbt tag of the player.
 * armor
 * Ranges from 0 to 20; represents the amount of armor points the player has. May appear as 0 for players before their armor has changed for the first time.
 * }
 * armor
 * Ranges from 0 to 20; represents the amount of armor points the player has. May appear as 0 for players before their armor has changed for the first time.
 * }
 * }
 * }

Compound criteria

 * Compound criteria's names are divided into parts, delimited with periods (.). For example,  is a valid compound criterion, under which player scores would increment whenever they're killed by zombie.


 * All objectives based on compound criteria is writable and can be modified with commands.


 * All statistics can be used as a compound criterion whose name is its namespaced ID. Player statistics are stored separately from the scoreboard, and as they update, scores in these objectives are updated in parallel.


 * In addition, there are some other compound criteria:

{| class="wikitable" style="width:100%" data-description="Compound criteria" ! Criteria base name ! Description ! Number of sub-criteria


 * teamkill.
 * Sub-criteria include team colors. Player scores increment when a player kills a member of the given colored team.
 * Sub-criteria include team colors. Player scores increment when a player kills a member of the given colored team.

These criteria follow the complete format, where   is a color from the list:
 * style="text-align:center"|16


 * killedByTeam.
 * Sub-criteria include team colors. Player scores increment when a player has been killed by a member of the given colored team.
 * Sub-criteria include team colors. Player scores increment when a player has been killed by a member of the given colored team.

These criteria follow the complete format, where   is a color from the list:


 * style="text-align:center"|16
 * }

Bedrock Edition
Currently,  is the only criterion supported. As such, score can only be changed by commands.

Display slots


Via the 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.

Players commands
{| class="wikitable" style="width:100%" data-description="Players commands" ! width="35%" | Commands ! width="65%" | Description
 * scoreboard players list [ ] scoreboard players list [playername: target] || Lists all score holders which are tracked in some way by the scoreboard system. The optional  or   parameter is used to list the scores of particular score holders.
 * scoreboard players get  || Return the scoreboard value.
 * scoreboard players set   is specified, then only that objective is cleared. Otherwise, this applies to all objectives. Note that this does not merely set the score(s) to 0: it removes the targets from the scoreboard altogether (or for the given objective).
 * scoreboard players test    [] || Tests if targets' scores are within   and   (Defaults to 2,147,483,647).   can be replaced with asterisk (*) to represent -2,147,483,648, and   can be replaced with asterisk (*) to represent 2,147,483,647.
 * scoreboard players enable  || Enables the target player(s) to use the  command on the specified objective. This command accepts non-player entities, but only players are able to actually use the  command. Until this has been done, players that attempt to  that objective fail. Using the  command disables it again. Note that if the target(s) did not previously have a score for the specified objective, this command will set their score to 0.
 * scoreboard players operation .
 * : The internal name of this objective.
 * : The way the score is displayed. Can be "integer" or "hearts", but 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 in JSON. If none was specified during the team's creation, this is set to.
 * : The internal name of this team.
 * : The prefix prepended to names of players on this team. In JSON format.
 * : The suffix appended to names of players on this team. In JSON format
 * : 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 (see below).
 * : The suffix appended to names of players on this team. In JSON format
 * : 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 (see below).