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—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 #Criteria). 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. The player name doesn’t need to belong to an actual player. 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 scores argument (syntaxed @e[scores={<name>=<min>..<max>}]. This argument uses <name> 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.
=== Criteria ===
==== Java Edition ====
===== Single criteria =====
:These criteria's names consist of a single alphabetical string.
:
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. 	
===== Compound criteria =====
:Compound criteria's names are divided into parts, delimited with periods (.). For example, minecraft.killed_by:minecraft.zombie 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 identifier. 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:
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.
These criteria follow the complete format teamkill.<team>, where <team> is a color from the list:
 {| class="collapsible collapsed collapse-button-none" data-description="Valid team colors"	
Accepted ID Names 	 	
 	 	
==== Bedrock Edition ====
Currently, dummy 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.
Slot 	Description
list 	Displays a yellow number or some hearts () without a heading on the tab menu, where online players are shown. 
Displays a white number without a heading on the Pause Menu, where online players are shown.
Visible even in singleplayer.
sidebar 	Shows on the right hand side of the screen. Shows up to 15 entities with the highest score of that objective with a heading labeled with the objective's <DisplayName>. Note that players are shown even if offline, and untracked players are not shown. In addition, fake players with names starting with a # do not show up in the sidebar under any circumstances.
 	There are 16 team-specific sidebar display slots. These operate the same as the standard sidebar slot, but only display to players who are on teams which use the specified color (for example, "sidebar.team.green" displays to players on "green" teams). Valid colors are: .
belowName	Shows the <Score> followed by the objective's <DisplayName> below the player's nametag above their head. This is hidden beyond ~10 blocks and when the player is sneaking. Not visible in singleplayer.
== Tags ==
Tags are a simple list of single-word strings stored directly in the 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.
== Teams ==
A team's all variables are: a name, a display name, a member name prefix, a member name suffix, a boolean allow friendly fire option, and a list of players who are on the team.
A team's Name is used internally for reference in commands, target arguments, and the file format. It is a single, case-sensitive word.
A team's DisplayName is a JSON text component of one or more case-sensitive word, and is displayed publicly in various situations.
A team's Member Name Prefix & Member Name Suffix are inserted before and after the names of players on the team, respectively. Prefixes and suffixes are used in the chat, the active players list, the sidebar, and above team members' heads. These can be edited with respective commands.
The AllowFriendlyFire option controls whether or not members of a team are able to damage each other. This defaults to true, leaving PvP mechanics unchanged—ergo, players can harm their teammates. When set to false, however, players on the same team are prevented from directly damaging 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 <AllowFriendlyFire> is false. Some non-player entities in a team are also affected by this.
It is important to note that each individual team member can only be on one team; teams cannot share entities.
Commands can be used to check whether team members exist by using target selection with the "team" argument. (The '!' character may be placed before a name to check for entities not on a team.) For example, inputting into a command block provides comparator output if any player exists on the red team. Conversely, provides output when there are no players on the red team. allows output when any player is on at least one team, and allows output when no players are on any teams.
== Command reference ==
For more details, see Commands/scoreboard.
=== Objectives commands ===
Commands 	Description
scoreboard objectives list 	List all existing objectives with their display names and criteria.
scoreboard objectives add <objective> <criteria> [<displayName>] scoreboard objectives add <objective: string> dummy [displayName: string]	Create a new objective with the given internal objective name, specified criterion, and the optional display name. , "dummy" is the only criterion currently supported. <displayName> defaults to <objective> when unspecified. See above section for more on these arguments.
scoreboard objectives remove <objective> scoreboard objectives remove <objective: string> 	Delete all references to the named objective in the scoreboard system. Data is deleted from the objectives list and score holders' scores, and if it was on a display list it is no longer displayed.
sidebar> [objective: string] [ascending|descending] scoreboard objectives setdisplay belowname [objective: string] 	descending to specify the sort order. Note that the objective parameter is optional; if no objective is provided, this display slot is cleared (returned to its default state).
scoreboard objectives modify <objective> displayname <displayName> 	Change the display name of the scoreboard in display slots.
integer) 	Change the display format of the player list.
=== Players commands ===
Commands 	Description
scoreboard players list [<target>] scoreboard players list [playername: target] 	Lists all score holders which are tracked in some way by the scoreboard system. The optional <target> or playername: target parameter is used to list the scores of particular score holders.
scoreboard players get <target> <objective> 	Return the scoreboard value.
scoreboard players set <targets> <objective> <score>scoreboard players set <player: targets> <objective: string> <count: int> 	Set the targets' scores of the given objective, overwriting any previous score.
scoreboard players add <targets> <objective> <score>scoreboard players add <player: targets> <objective: string> <count: int> 	Increments the targets' scores in that objective by the given amount.
scoreboard players remove <targets> <objective> <score>scoreboard players remove <player: targets> <objective: string> <count: int> 	Decrements the targets' scores in that objective by the given amount.
scoreboard players random <player: target> <objective: string> <min: int> <max: int> 	Sets the targets' scores in that objective to a random number between min and max, both inclusive.
scoreboard players reset <targets> [<objective>]scoreboard players reset <player: target> [objective: string] 	Deletes score or all scores for the target. If <objective> 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 <player: target> <objective: string> <min: wildcard int> [<max: wildcard int>] 	Tests if targets' scores are within min: wildcard int and max: wildcard int (Defaults to 2,147,483,647). min: wildcard int can be replaced with asterisk (*) to represent -2,147,483,648, and max: wildcard int can be replaced with asterisk (*) to represent 2,147,483,647.
scoreboard players enable <targets> <objective> 	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 <targets> <targetObjective> <operation> <source> <sourceObjective>scoreboard players operation <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string>	Applies an arithmetic operation altering the targets' score(s) in the target objective, using sources' scores in the source objective as input.
<operation> may be:
* "+=" Addition: Add source's score to that of target
* "-=" Subtraction: Subtract source's score from that of target
* "*=" Multiplication: Set target's score to the product of target's and source's scores
* "/=" (Integer) Division: Divide target's score by source's score, and use the result (rounded down) to set the target score.
* "%=" Modulus: Divide target's score by source's score, and use the remainder to set the target score
* "=" Assign: Set target's score to that of source
* "<" Min: Set target's score to source's score only if source has the lesser score.
* ">" Max: Set target's score to source's score only if source has the greater score.
* "><" Swaps target's and source's scores
In all cases except "><", source's score remains unchanged. If target or source isn't tracked by the specified objective, it will be set to 0. If more than one score holder is specified as sources, performs the operation once with each source's score. If more than one target score holder is specified, performs the operation for each target one by one.
=== Tags commands ===
=== Teams commands ===
== 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 criterion of this objective.
***** : The display name of this objective in JSON. If none was specified during the objective's creation, this is set to {"text":"Value of Name"}.
***** : 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 {"text":"Value of Name"}.
***** : 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).
Display slots
No.	Type 	Name
0 	Player list 	list
1 	On the sidebar 	sidebar
2 	Below the player's username	belowName
3 	Team color 	sidebar.team.black
4 	Team color 	sidebar.team.dark_blue
5 	Team color 	sidebar.team.dark_green
6 	Team color 	sidebar.team.dark_aqua
7 	Team color 	sidebar.team.dark_red
8 	Team color 	sidebar.team.dark_purple
9 	Team color 	sidebar.team.gold
10 	Team color 	sidebar.team.gray
11 	Team color 	sidebar.team.dark_gray
12 	Team color 	sidebar.team.blue
13 	Team color 	sidebar.team.green
14 	Team color 	sidebar.team.aqua
15 	Team color 	sidebar.team.red
16 	Team color 	sidebar.team.light_purple
17 	Team color 	sidebar.team.yellow
18 	Team color 	sidebar.team.white
==History==
==Issues==
==Gallery==
Dirt Dug Dinnerbone.png|A "dirt dug" scoreboard.
Pigs Killed Dinnerbone.png|A "pigs killed" scoreboard.
Deaths by Zombie Dinnerbone.png|A "deaths by zombie" scoreboard.
Scoreboard Objectives.png|A long list of scoreboard objectives.
==References==
de:Anzeigetafel
es:Marcador
fr:Tableau de score
ja:スコアボード
ko:스코어보드
nl:Scorebord
pl:Tablica wyników
pt:Placar
ru:Система счёта игровых событий
uk:Табло
zh:记分板