minecraft.wiki-mirror/wiki_backup/team.txt
2024-12-24 06:17:34 -05:00

508 lines
36 KiB
Text

{{For|the Legacy Console Edition Leaderboard|Leaderboards}}
{{For|the command|Commands/scoreboard}}
{{Redirect|scores|the other mechanic named "score"|Experience#Score}}
[[File:Scoreboard.png|thumb|350px|A screenshot of a scoreboard on the right side of the screen.]]
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 ==
An '''objective''' tracks a score for entities while meeting a single criterion. These scores are stored as 32-bit integer ranging from -2<sup>31</sup> to 2<sup>31</sup>-1.{{fn|Actual values are -2,147,483,648 and 2,147,483,647.}}
Objectives have two main properties: a '''name''' and a '''criterion'''. The objectives' name is used internally for referencing in commands, target arguments, and the [[#NBT format|file format]], while the criterion determines the objectives' behavior &mdash; primarily what to track.
{{IN|java}}, the objectives' name must be a single, case-sensitive string consisting of {{w|alphanumeric}} characters, hyphen {{cd|-}}, plus {{cd|+}}, dot {{cd|.}}, and underscore {{cd|_}}. {{IN|bedrock}}, it must either be a single string that has no space or a quoted string. When a string is quoted, blackslash {{cd|\}} can be used to escape characters.
The entity's '''score''' in any objective can be changed from [[#Command reference|commands]], unless it's read-only and automatically set by the game (see {{slink||Criteria}}). It can be increased by, decreased by, or set to a given amount with commands. Non-player entities only support dummy criterion in the scoreboard; their scores can only be changed by commands and not automatically by the game. Unlike players, when a non-player entity dies, its scores are deleted.
The score holder's name can either be the player's name or the entity's [[UUID]]. For players, the score holder's name doesn't need to belong to an actual [[player]].
Objectives also have other properties to change its appearance and behavior:
{| class="wikitable"
! Property
! Description
|-
| displayname
| The objective's display name that appears in the player list, above the player head, and the sidebar. By default, the objective's name is the display name.
|-
| numberformat
| The objective's number format for the score. The value can be <code>blank</code>, <code>fixed</code>, or <code>styled</code>.
* <code>blank</code> displays nothing on the scoreboard.
* <code>fixed</code> displays the contents specified in the command.
* <code>styled</code> displays the score number with the styling applied from the [[raw JSON text format]], such as <code>"color"</code>, <code>"italic"</code>, <code>"bold"</code>, and etc. This means that the <code>"text"</code> JSON property is ignored.
|-
| rendertype
| The objective's render type for the score. The score can be rendered by integers or hearts.
When the score is greater than 44, the hearts displayed turn into <code>&lt;integer>hp</code> in the player list (not in the sidebar, instead, only integers are shown), and the <code>&lt;integer></code> is divided by 2.
|-
| displayautoupdate
| Whether or not to display auto updates when the score has changed. The value can be <code>true</code> (default) or <code>false</code>.
|-
|}
The number format property and the score holder's name can be changed per-entity using {{cmd|scoreboard players display numberformat<nowiki>|name</nowiki> &lt;target> ...}}.
Server [[operator]]s can select entities by their scores using [[target selector]] with the "scores" argument (syntax: <code>@e[scores={&lt;name>=&lt;min>..&lt;max>}]</code>). This argument uses the <code>&lt;name></code> argument to specify the score name of the objective. For example, inputting {{cmd|1=execute if entity @a[scores={deaths=1..}]}} into a [[command block]] triggers a [[comparator]] or [[Command Block#Modification|conditional command block]] if any player has died at least once ever since the objective was created, assuming the <code>deaths</code> objective has the <code>deathCount</code> criterion.
== Criteria ==
A '''criterion''' determines an objective's behavior, primarily what to track. When a criterion's source value changes, the change is automatically reflected in the objective's score.
{{IN|je}}, criteria are categorized by single and compound criteria. Each of the criteria tracks specific things, such as players' [[health]], [[hunger]], [[experience]], [[trigger]]s, [[statistic]]s, and among other things. {{IN|be}}, the "dummy" criterion is the only criteria supported. As such, scores can only be changed by commands.
=== Single criteria ===
{{exclusive|java|section=1|customtext=This feature is primarily exclusive to ''[[Java Edition]]''.}}
Single criteria names consist of an alphabetical string.
{| class="wikitable" style="width:100%" data-description="Criteria"
! Criteria name
! Description
! Can be modified
|-
| dummy
| A score that can be changed only by commands and not automatically by the game. This can be used for storing integer states and variables, which can then be used with the scoreboard's operations to perform arithmetic calculations.
| {{tc|yes|style=text-align:center}}
|-
| trigger
| A score that can be changed by commands and not automatically by the game. The {{cmd|trigger}} command allows players to set, increment, or decrement their own score. The command fails if the objective has not been "enabled" for the player using it. After a player uses it, the objective is automatically disabled for them. By default, all trigger objectives are disabled for players. Ordinary players can use the {{cmd|trigger}} command, even if [[cheats]] are disabled or they are not [[Operator|server operators]], making it useful for safely taking input from non-operator players.
| {{tc|yes|style=text-align:center}}
|-
| deathCount
| The score increments automatically when a player dies.
| {{tc|yes|style=text-align:center}}
|-
| playerKillCount
| The score increments automatically when a player kills another player.
| {{tc|yes|style=text-align:center}}
|-
| totalKillCount
| The score increments automatically when a player kills another player or a mob.
| {{tc|yes|style=text-align:center}}
|-
| health
| Ranges from 0 to 20 (and greater) for a normal player; represents the amount of half-hearts a player has. It may appear as 0 for players before their health has changed for the first time. The health score can surpass 20 points with extra hearts from [[attribute]]s, [[Health Boost]] or [[Absorption]] effects.
| {{tc|no|style=text-align:center}}
|-
| xp
| Matches the total amount of [[experience]] the player has collected since their last death.
| {{tc|no|style=text-align:center}}
|-
| level
| Matches the current experience level of the player.
| {{tc|no|style=text-align:center}}
|-
| food
| Ranges from 0 to 20; represents the amount of hunger points a player has. It may appear as 0 for players before their food level has changed for the first time.
| {{tc|no|style=text-align:center}}
|-
| air
| Ranges from 0 to 300; represents the amount of air a player has left while [[swimming]] underwater. It matches the air NBT tag of the player.
| {{tc|no|style=text-align:center}}
|-
| armor
| Ranges from 0 to 20; represents the amount of armor points a player has. It may appear as 0 for players before their armor level has changed for the first time.
| {{tc|no|style=text-align:center}}
|}
=== Compound criteria ===
{{exclusive|java|section=1}}
Compound criteria names are divided into parts, delimited with periods {{cd|.}}. For example, {{cd|minecraft.killed_by:minecraft.zombie}} is a valid compound criterion, under which a player's score increments whenever they are killed by a zombie.
Objectives based on a compound criterion are writable and can be modified with commands.
[[Statistics]] can be used as compound criteria whose name are their [[Statistics#Resource location|identifier]]. Player statistics are stored separately from the scoreboard, and as they update, the scores in these objectives are updated too.
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.&lt;team_color>
| 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 <code>teamkill.&lt;team_color></code>, where <code>&lt;team_color></code> is a color from the list:
{| class="collapsible collapsed collapse-button-none" data-description="Valid team colors"
|-
! style="text-align:left" | Accepted ID Names
|-
|
"black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"
|}
| style="text-align:center"|16
|-
| killedByTeam.&lt;team_color>
| Sub-criteria include team colors. Player scores increment when a player is killed by a member of the given colored team.
These criteria follow the complete format <code>killedByTeam.&lt;team_color></code>, where <code>&lt;team_color></code> is a color from the list:
{| class="collapsible collapsed collapse-button-none" data-description="Valid team colors"
|-
! style="text-align:left" | Accepted ID Names
|-
|
"black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"
|}
| style="text-align:center"|16
|}
== Score operations ==
Players can increment, decrement, reset and modify an entity's scores by a specific amount with commands. Players can also set scores to a random number within a range{{only|BE}}, they can also test if the scores are set between specific min and max values.
Scores can also be modified by using '''arithmetic operations''' like addition, subtraction, multiplication, and etc. These operations take the target entity's score and execute it with another score from a different entity. The result of such operations is then assigned as the new target score.
For example, executing an addition operation on a target entity's score with a source entity's score can be expressed as:
<math>\text{New Target Score} = \text{Target Score} + \text{Source Score}</math>
Below is a list of available arithmetic operations.
{|class="wikitable"
|-
! Operation !! Description
|-
| style="text-align: center;" |+= || Adds the target's score and the source's score. <br><math>\text{New Target Score} = \text{Target Score} + \text{Source Score}</math>
|-
| style="text-align: center;" |-= || Subtracts the target's score and the source's score. <br><math>\text{New Target Score} = \text{Target Score} - \text{Source Score}</math>
|-
| style="text-align: center;" |*= || Multiplies the target's score and the source's score. <br><math>\text{New Target Score} = \text{Target Score} \times \text{Source Score}</math>
|-
| style="text-align: center;" |/= || Divides the target's score and the source's score, then applies the {{w|Floor and ceiling functions|floor}} function on the result. <br><math>\text{New Target Score} = \left\lfloor \frac{\text{Target Score}}{\text{Source Score}} \right\rfloor</math>
|-
| style="text-align: center;" |%= || Applies the {{w|modulo}} operation on the target's score and the source's score, returning the remainder of a division. <br><math>\text{New Target Score} = \text{Target Score} \mod \text{Source Score}</math>
|-
| style="text-align: center;" |= || Assigns the source's score as the new target's score without applying any other arithmetic operations whatsoever. <br><math>\text{New Target Score } = \text{ Source Score}</math>
|-
| style="text-align: center;" |< || Assigns the minimum value between the target's score and the source's score. It will compare and pick the lowest score value between the target's and the source's scores. <br><math>\text{New Target Score} = \min(\text{Target Score}, \text{Source Score})</math>
|-
| style="text-align: center;" |> || Assigns the maximum value between the target's score and the source's score. It will compare and pick the highest score value between the target's and the source's scores. <br><math>\text{New Target Score} = \max(\text{Target Score}, \text{Source Score})</math>
|-
| style="text-align: center;" |>< || Swaps the target's score and the source's score. The target's score will be the source's score, and the source's score will be the target's score. <br><math>\text{Target Score } \leftrightarrow \text{ Source Score}</math>
|}
For arithmetic operations, if there is more than one score holder specified as the sources, the game executes the operations once with each source's score, and if there is more than one target score holder, the game executes the operations for each target one by one.
These operations are available by using the scoreboard [[Commands/scoreboard#Players commands|players commands]], e.g. {{cmd|scoreboard players operation <targets> <targetObjective> <operation> <source> <sourceObjective>}} for arithmetic operations, {{cmd|scoreboard players set <targets> <objective> <score>}} to set a target entity's score, and {{cmd|scoreboard players test <player: target> <objective: string> <min: wildcard int> [<max: wildcard int>]}} to test a target entity's score{{only|BE}} ({{in|je}}, you'd use {{cmd|execute if <targets>}} and the {{cd|1=[scores={<objective>=<min>..<max>}]}} [[Target_selectors#Target_selector_arguments|target selector argument]]).
== Display slots ==
[[File:Scoreboard Display.png|thumb|250px|An objective with two points to the player is displayed in the "list" slot, while an objective with the display name "Quest Points" with 0 points to the player is displayed in the "sidebar" slot.]]
An entity's scores in objectives can be displayed in certain slots in the game. These slots are called '''display slots''', and they can appear in the player list, the sidebar, below a player's [[Player#Username|name tag]], etc. Each display slot can show one objective at a time, and multiple display slots may be used for the same or different objectives.
Display slots can be set by {{cmd|scoreboard objectives setdisplay}} command (see {{section link||Command reference}}).
{| class="wikitable" style="width:100%" data-description="Display slots"
! width="140" |Slot
! Description
|-
|list|| Displays a yellow number or some hearts ({{cmd|scoreboard objectives modify ? rendertype ?}}) without a heading on the tab menu, where online players are shown.{{only|java}}
Displays a white number without a heading on the Pause Menu, where online players are shown.{{only|bedrock}}
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.
|-
|{{nohtml|sidebar.team.<color>}} {{only|java}}|| There are 16 team-specific sidebar display slots. These operate the same as the standard sidebar slot, but display only to players who are on teams that use the specified color (for example, "sidebar.team.green" displays to players on "green" teams). Valid colors are: "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white".
|-
|below_name|| 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 ==
{{For|the command|Commands/tag}}
'''Tags''' are a simple list of single-word strings stored directly in the [[Entity format|{{nbt|list|Tags}}]] [[Commands#Data tags|data tag]] of an entity, with a maximum limit of 1024 tags. As with objectives, tags are case-sensitive.
Target selectors can be used to check whether an entity has a tag with the [[Target selectors#Selecting targets by tag|"tag" argument]].
== Teams ==
{{redirect|team|the command|Commands/team}}
{{exclusive|java|section=1}}
'''Teams''' group entities or players together as allies.
Each entity can only have a single team and cannot share with other different team member. If a player is teamed with a hostile entity, that entity will not attack the player in the same team. This unique behavior is also apparent with a neutral entity who would normally attack hostile entities, for example, the [[iron golem]].
Teams have a '''name''' property, used internally for reference in commands, target arguments, and the file format. Like objectives, it is a single, case-sensitive string consisting of alphanumeric characters. Teams also have other several properties to set its appearances and behaviors:
{| class="wikitable"
! Property
! Description
! Value
|-
| displayName
| Sets the team's display name that appears on the player name in chat, nametag, player list menu, and on the scoreboard sidebar.
| [[Raw JSON text format]]
|-
| color
| Sets the team's color that appears on the player name in chat, nametag, player list menu, and on the scoreboard sidebar. It also changes the color of the entities outline caused by the [[Glowing]] effect.
| "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"
|-
| collisionRule
| Controls a member's collision rule with other team members, or their own.
| "always" (default), "never", "pushOtherTeams", "pushOwnTeam"
|-
| deathMessageVisibility
| Controls a member's [[death message]] visibility with other team members, or their own.
| "always" (default), "never", "hideForOtherTeams", "hideForOwnTeam"
|-
| nametagVisibility
| Controls a member's [[Player#Username|name tag]] visibility from other team members, or their own. Members' nametag is visible above the [[player head]].
| "always" (default), "never", "hideForOtherTeams", "hideForOwnTeam"
|-
| friendlyFire
| Toggles the team's friendly fire rule that controls if a member can attack other members on the same team. The attack damage can be from melee attack, bow and arrow, [[splash potion]] of [[Harming]], and more. Note that team members may still inflict negative status effects on each other with potions, like with a splash potion of [[Poison]].
| "true" (default) or "false"
|-
| seeFriendlyInvisibles
| Toggles a member's visibility to other members on the same team with [[Invisibility]] effect.
| "true" (default) or "false"
|-
| prefix
| Sets the team's prefix that appears before the member's name in the chat, nametag, and the player list menu.
| A quoted string.
|-
| suffix
| Sets the team's suffix that appears after the member's name in the chat, nametag, and the player list menu.
| A quoted string.
|-
|}
Commands can be used to check whether team members exist by using target selection with the "team" argument. An exclamation point {{cd|!}} character may be placed before a team name to check for entities ''not'' on that team. For example, inputting {{cmd|1=execute if entity @a[team=red]}} into a [[command block]] provides [[comparator]] output if any player exists on the red team. Conversely, {{cmd|1=execute if entity @a[team=!red]}} provides output when there are any players ''not'' on the red team. {{cmd|1=execute if entity @a[team=!]}} allows output when at least one player is on ''any'' team, and {{cmd|1=execute if entity @a[team=]}} allows output when at least one player is on ''no'' team.
== Command reference ==
{{main|Commands/scoreboard}}
=== Objectives commands ===
{| class="wikitable" style="width:100%" data-description="Objectives commands"
! width="35%" | Commands
! width="65%" | Description
|-
| '''scoreboard objectives list''' || List all existing objectives with their display names and criteria.
|-
| '''scoreboard objectives add''' <objective> <criteria> [<displayName>]{{only|java}}<br> '''scoreboard objectives add''' <objective: string> dummy [displayName: string]{{only|bedrock}} || Create a new objective with the given internal objective name, specified criterion, and the optional display name. {{IN|bedrock}}, "dummy" is the only criterion currently supported. <code><displayName></code> defaults to <code><objective></code> when unspecified. See [[#Objectives|above section]] for more on these arguments.
|-
| '''scoreboard objectives remove''' <objective>{{only|java}}<br> '''scoreboard objectives remove''' <objective: string>{{only|bedrock}} || 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.
|-
| '''scoreboard objectives setdisplay''' <slot > [<objective ]{{only|java}}<br> '''scoreboard objectives setdisplay''' <list|<nowiki>sidebar> [objective: string] [ascending|descending]</nowiki>{{only|bedrock}}<br> '''scoreboard objectives setdisplay''' belowname [objective: string]{{only|bedrock}} || Display score info for the objective in the given slot. Valid slots are listed and described in [[#Display_slots|Display Slots]]. {{IN|bedrock}}, if slot is <code>list</code> or <code>sidebar</code>, there is an additional optional argument <code>ascending|descending</code> 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> {{only|java}}|| Change the display name of the scoreboard in display slots.
|-
| '''scoreboard objectives modify''' <objective> '''rendertype''' (hearts<nowiki>|</nowiki>integer) {{only|java}}|| Change the display format of the player list.
|-
|}
=== Players commands ===
{| class="wikitable" style="width:100%" data-description="Players commands"
! width="35%" | Commands
! width="65%" | Description
|-
| '''scoreboard players list''' [<target>]{{only|java}}<br> '''scoreboard players list''' [playername: target]{{only|bedrock}} || Lists all score holders that are tracked in some way by the scoreboard system. The optional <code><target></code> or <code>playername: target</code> parameter is used to list the scores of particular score holders.
|-
| '''scoreboard players get''' <target> <objective> {{only|java}} || Return the scoreboard value.
|-
|'''scoreboard players set''' <targets> <objective> <score>{{only|java}}<br>'''scoreboard players set''' <player: targets> <objective: string> <count: int>{{only|bedrock}} || Set the targets' scores of the given objective, overwriting any previous score.
|-
| '''scoreboard players add''' <targets> <objective> <score>{{only|java}}<br>'''scoreboard players add''' <player: targets> <objective: string> <count: int>{{only|bedrock}} || Increments the targets' scores in that objective by the given amount.
|-
| '''scoreboard players remove''' <targets> <objective> <score>{{only|java}}<br>'''scoreboard players remove''' <player: targets> <objective: string> <count: int>{{only|bedrock}} || Decrements the targets' scores in that objective by the given amount.
|-
|'''scoreboard players random''' <player: target> <objective: string> <min: int> <max: int> {{only|bedrock}}||Sets the targets' scores in that objective to a random number between min and max, both inclusive.
|-
| '''scoreboard players reset''' <targets> [<objective>]{{only|java}}<br>'''scoreboard players reset''' <player: target> [objective: string]{{only|bedrock}} || Deletes score or all scores for the target. If <code><objective></code> 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>] {{only|bedrock}} || Tests if targets' scores are within <code>min: wildcard int</code> and <code>max: wildcard int</code> (Defaults to 2,147,483,647). <code>min: wildcard int</code> can be replaced with asterisk (*) to represent -2,147,483,648, and <code>max: wildcard int</code> can be replaced with asterisk (*) to represent 2,147,483,647.
|-
| '''scoreboard players enable''' <targets> <objective> {{only|java}} || Enables the target player(s) to use the {{cmd|trigger}} command on the specified objective. This command accepts non-player entities, but only players can actually use the {{cmd|trigger}} command. Until this has been done, players that attempt to {{cmd|trigger}} that objective fail. Using the {{cmd|trigger}} command disables it again. Note that if the target(s) did not previously have a score for the specified objective, this command sets their score to 0.
|-
| '''scoreboard players operation''' <targets> <targetObjective> <operation> <source> <sourceObjective>{{only|java}}<br>'''scoreboard players operation''' <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string>{{only|bedrock}} || 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 is 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 ===
{{main|Commands/tag}}
=== Teams commands ===
{{exclusive|java|section=1}}
{{main|Commands/team}}
== NBT format ==
{{exclusive|java|section=1}}
The file '''scoreboard.dat''' in the 'data' folder of a Minecraft world stores the scoreboard data for that world as a {{w|gzip|newtab=1}} compressed [[NBT]] file:
<div class="treeview">
* {{nbt|compound}} The root tag.
**{{nbt|compound|data}}: The scoreboard data.
***{{nbt|list|Objectives}}: A list of compound tags representing objectives.
**** {{nbt|compound}} An objective.
***** {{nbt|string|CriteriaName}}: The criterion of this objective.
***** {{nbt|string|DisplayName}}: The display name of this objective in JSON. If none was specified during the objective's creation, this is set to <code>{"text":"''Value of Name''"}</code>.
***** {{nbt|string|Name}}: The internal name of this objective.
***** {{nbt|string|RenderType}}: The way the score is displayed. Can be "integer" or "hearts", but defaults to "integer".
***** {{nbt|byte|display_auto_update}}: 1 or 0 (true/false) - Whether the display names in the sidebar automatically updates whenever the score values are changed.
***** {{nbt|compound|format}}: Optional, the default number format for this objective.
****** {{nbt|string|type}}: One of <code>blank</code>, <code>fixed</code>, or <code>result</code> (called <code>styled</code> in the command).
****** Additional fields based on the type.
*** {{nbt|list|PlayerScores}}: A list of compound tags representing scores tracked by the scoreboard system.
**** {{nbt|compound}} A tracked player/objective pair with a score.
***** {{nbt|int|Score}}: The score this player has in this objective.
***** {{nbt|string|Name}}: The name of the player who has this score in this objective.
***** {{nbt|string|Objective}}: The internal name of the objective that this player has this score in.
***** {{nbt|byte|Locked}}: 1 or 0 (true/false) - false if this objective is "enabled". Meaningful only for objectives with the criteria "trigger", where this must be false before a player can use the /trigger command on it.
***** {{nbt|string|display}}: Optional, the text component used as display name in the sidebar.
***** {{nbt|compound|format}}: Optional, the number format of the player score.
****** {{nbt|string|type}}: One of <code>blank</code>, <code>fixed</code>, or <code>result</code> (called <code>styled</code> in the command).
****** Additional fields based on the type.
*** {{nbt|list|Teams}}: A list of compound tags representing teams.
**** {{nbt|compound}} A Team.
***** {{nbt|byte|AllowFriendlyFire}}: 1 or 0 (true/false) - true if players on this team can harm each other.
***** {{nbt|byte|SeeFriendlyInvisibles}}: 1 or 0 (true/false) - true if players on this team can see invisible teammates.
***** {{nbt|string|NameTagVisibility}}: The value of the nametagVisibility option of this team.
***** {{nbt|string|DeathMessageVisibility}}: The value of the deathMessageVisibility option of this team. Valid options are: never, hideForOtherTeams, hideForOwnTeam, always
***** {{nbt|string|CollisionRule}}: The value of the collisionrule option of this team. Valid options are: always, pushOwnTeam, never, pushOtherTeams
***** {{nbt|string|DisplayName}}: The display name of this team in JSON. If none was specified during the team's creation, this is set to <code>{"text":"''Value of Name''"}</code>.
***** {{nbt|string|Name}}: The internal name of this team.
***** {{nbt|string|MemberNamePrefix}}: The prefix prepended to names of players on this team. In JSON format.
***** {{nbt|string|MemberNameSuffix}}: The suffix appended to names of players on this team. In JSON format
***** {{nbt|string|TeamColor}}: The text-based color ("black", "dark_blue", etc.) given to the team. Does not exist if no color is set.
***** {{nbt|list|Players}}: A list of names of players on this team.
****** {{nbt|string}} The name of a player on this team.
*** {{nbt|compound|DisplaySlots}}: A set of slots that display specific objectives. If a slot is empty, its tag is not present.
****{{nbt|string|slot_''n''}}: The internal name of the objective displayed (see below).
</div>
{| class="wikitable"
|+Display slots
! No.!!Type!!Name
|-
|0||Player list|| list
|-
| 1||On the sidebar||sidebar
|-
|2 ||Below the player's username||belowName
|-
|3|| rowspan="16" | Team color||sidebar.team.black
|-
|4||sidebar.team.dark_blue
|-
|5 || sidebar.team.dark_green
|-
|6||sidebar.team.dark_aqua
|-
|7||sidebar.team.dark_red
|-
|8||sidebar.team.dark_purple
|-
|9||sidebar.team.gold
|-
| 10||sidebar.team.gray
|-
| 11||sidebar.team.dark_gray
|-
|12||sidebar.team.blue
|-
|13||sidebar.team.green
|-
|14|| sidebar.team.aqua
|-
| 15||sidebar.team.red
|-
|16||sidebar.team.light_purple
|-
| 17|| sidebar.team.yellow
|-
|18||sidebar.team.white
|}
== History ==
{{HistoryTable
|{{HistoryLine|java}}
|{{HistoryLine||1.5|dev=13w04a|Added scoreboard.}}
|{{HistoryLine|||dev=13w05a|Added team-based functionality.}}
|{{HistoryLine||1.7.2|dev=13w36a|Added statistic-based objective criteria.}}
|{{HistoryLine||1.8|dev=14w02a|Entities other than players can now be part of teams and have objective scores.}}
|{{HistoryLine|||dev=14w06a|Added the <code>trigger</code> and team kill-based objective criteria.
|Added <code>/scoreboard players enable</code>.
|"*" can be used in a player name argument to represent all players tracked by the scoreboard.
|Added the "objective" argument to <code>/scoreboard players reset</code>.
|Statistic objective criteria now use named IDs instead of numerical IDs.
|Added the <code>achievement.overpowered</code> objective criterion.}}
|{{HistoryLine|||dev=14w07a|Added <code>/scoreboard players operation</code> and <code>/scoreboard players test</code>.
|Scores for fake players that have a name beginning with "#" don't appear in the sidebar.
|Added team-specific sidebar display slots.|Added the <code>nametagVisibility</code> team option.}}
|{{HistoryLine|||dev=14w10a|Added the <code>deathMessageVisibility</code> team option.
|Added a <code>dataTag</code> argument to <code>/scoreboard players set</code>, <code>/scoreboard players add</code>, and <code>/scoreboard players remove</code>.
|Added the <code>stat.crouchOneCm</code>, <code>stat.sprintOneCm</code>, and <code>stat.timeSinceDeath</code> objective criteria.}}
|{{HistoryLine|||dev=14w25a|Added <code><nowiki>=</nowiki></code>, <code><</code>, and <code>></code> to <code>/scoreboard players operation</code>.}}
|{{HistoryLine|||dev=14w29a|Player/entity names in the sidebar are now secondarily sorted by alphabetical order.}}
|{{HistoryLine|||dev=14w30a|Added the <code>stat.talkedToVillager</code> and <code>stat.tradedWithVillager</code> objective criteria.}}
|{{HistoryLine|||dev=unknown|Added <code>><</code> to <code>/scoreboard players operation</code>.}}
|{{HistoryLine||1.8.2|Added the <code>stat.cauldronFilled</code>, <code>stat.cauldronUsed</code>, <code>stat.armorCleaned</code>, <code>stat.bannerCleaned</code>, <code>stat.brewingstandInteraction</code>, <code>stat.beaconInteraction</code>, <code>stat.dropperInspected</code>, <code>stat.hopperInspected</code>, <code>stat.dispenserInspected</code>, <code>stat.noteblockPlayed</code>, <code>stat.noteblockTuned</code>, <code>stat.flowerPotted</code>, <code>stat.trappedChestTriggered</code>, <code>stat.enderchestOpened</code>, <code>stat.itemEnchanted</code>, <code>stat.recordPlayed</code>, <code>stat.furnaceInteraction</code>, <code>stat.craftingTableInteraction</code>, <code>stat.chestOpened</code> objective criteria.}}
|{{HistoryLine||1.9|dev=15w32a|Added the <code>stat.sneakTime</code> objective criteria.}}
|{{HistoryLine|||dev=15w32b|Added <code>/scoreboard players tag</code>.
|Added the <code>xp</code>, <code>food</code>, and <code>air</code> objective types.}}
|{{HistoryLine|||dev=15w33a|Added the <code>stat.pickup</code> and <code>stat.drop</code> objective criteria.
|Added the <code>armor</code>, <code>level</code> objective types.}}
|{{HistoryLine|||dev=15w36a|Added <code>collisionRule</code>.}}
|{{HistoryLine|||dev=15w49a|Added the <code>stat.aviateOneCm</code> objective criteria.}}
|{{HistoryLine||1.13|dev=pre7|Added {{cmd|scoreboard objectives modify}}.}}
|{{HistoryLine|||dev=pre8|Added {{cmd|scoreboard objectives modify <''objectiveName''> rendertype ''hearts''|link=none}}, which makes health bars display as hearts, like this: {{Healthbar|12|total=20}}.
|Added {{cmd|scoreboard objectives modify <objectiveName> rendertype ''integer''|link=none}}, which makes health bars display as yellow numbers.
|Objective names are now text components, not raw strings.}}
|{{HistoryLine||1.13.1|dev=18w31a|Changed the scoreboard operator {{code|%{{=}}}} from using {{code|%}} to {{code|Math.floorMod}}.}}|{{HistoryLine||1.18|dev=21w37a|Removed 16-character length limits for scoreboards, score holders and team names.}}
|{{HistoryLine||1.20.2|dev=23w31a|The {{cd|belowName}} display slot selector is now {{cd|below_name}}.}}
|{{HistoryLine||1.20.3|dev=23w46a|Added custom display settings for scores in the sidebar.}}
|{{HistoryLine|bedrock}}
|{{HistoryLine||1.7.0|dev=beta 1.7.0.2|Added basic scoreboard mechanics.
|Added dummy scoreboards.}}
}}
== Issues ==
{{issue list}}
== Gallery ==
=== Screenshots ===
<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.
</gallery>
== Notes ==
{{fnlist}}
== Navigation ==
{{Navbox gameplay}}
{{Navbox Java Edition technical|general}}
[[de:Anzeigetafel]]
[[es:Marcador]]
[[fr:Tableau de score]]
[[ja:スコアボード]]
[[ko:스코어보드]]
[[nl:Scorebord]]
[[pl:Tablica wyników]]
[[pt:Placar]]
[[ru:Система счёта игровых событий]]
[[uk:Табло]]
[[zh:记分板]]