Commands/scoreboard

Manages and displays scores for various scoreboard objectives.
== Objectives commands ==
=== list ===
:;Syntax
::scoreboard objectives list
:;Description
::List all existing objectives with their display names and criteria.
:;Result
::
:;Output
::
=== add ===
:;Syntax
::scoreboard objectives add <objective> <criteria> [<displayName>] ()scoreboard objectives add <objective: string> dummy [displayName: string] ()
:;Description
::Create a new objective with the given internal objective name, specified criterion, and the optional display name.
:;Arguments
::
::: Specifies the internal objective name.
::: , it must be either a single word that isn't a number (allowed characters: , , , and ) or a double-quoted string.
::
::: Specifies the criterion of the new objective.
::: , "dummy" is the only criterion currently supported.
::
::: Specifies the display name, defaulting to <objective> when unspecified.
::: , must be a raw JSON text. , it must be either a single word that isn't a number (allowed characters: , , , and ) or a double-quoted string.
:;Result
::
:;Output
::
=== remove ===
:;Syntax
::scoreboard objectives remove <objective> ()scoreboard objectives remove <objective: string> ()
:;Description
::Delete the named objective from 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.
:;Arguments
::
::: Specifies the internal objective name.
::: 
:;Result
::
:;Output
::
=== setdisplay ===
:;Syntax
::scoreboard objectives setdisplay <slot> [<objective>] ()scoreboard objectives setdisplay <list|sidebar> [objective: string] [ascending|descending] ()scoreboard objectives setdisplay belowname [objective: string] ()
:;Description
::Display score info for the objective in the given slot. Note that the objective parameter is optional; if no objective is provided, this display slot is cleared (returned to its default state). , if slot is list or sidebar, there is an additional optional argument ascending|descending to specify the sort order.
:;Arguments
::
::: Specifies the slot to display the objective.
::: Valid slots are listed and described in Display Slots.
::
::: Specifies the internal objective name.
::: 
::: ascending|descending
::: Specifies the sort order.
:;Result
::
:;Output
::
=== modify ... displayname ===
:;Syntax
::scoreboard objectives modify <objective> displayname <displayName> ()
:;Description
::Change the display name of the scoreboard in display slots.
:;Arguments
::
::: Specifies the internal objective name.
::: 
::
::: Specifies the display name.
::: 
:;Result
::
:;Output
::
=== modify ... rendertype ===
:;Syntax
::scoreboard objectives modify <objective> rendertype (hearts|integer) ()
:;Description
::Change the display format for scores in the tab player list.
:;Arguments
::
::: Specifies the internal objective name.
::: 
::hearts|integer
::: Specifies the format.
:;Result
::
:;Output
::
== Players commands ==
=== list ===
:;Syntax
::scoreboard players list [<target>] ()scoreboard players list [playername: target] ()
:;Description
::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.
:;Arguments
::
::: Specifies the score holder(s).
::: 
::: , only a single score holder can be specified, and * doesn't work (). , it can specify multiple score holders.
:;Result
::
:;Output
::
=== get ===
:;Syntax
::scoreboard players get <target> <objective> ()
:;Description
::Return the scoreboard value. Can be used in conjunction with the command: 
:;Arguments
::
::: Specifies the score holder.
::: Only a single score holder can be specified, and * doesn't work.
::
::: Specifies the objective to get score from it.
::: 
:;Result
::
:;Output
::
=== set ===
:;Syntax
::scoreboard players set <targets> <objective> <score> ()scoreboard players set <player: target> <objective: string> <count: int> ()
:;Description
::Set the targets' scores in the given objective, overwriting any previous score.
:;Arguments
::
::: Specifies the score holders.
::: 
::
::: Specifies the objective.
:::
::
::: Specifies the new score.
::: 
:;Result
::
:;Output
::
=== add ===
:;Syntax
::scoreboard players add <targets> <objective> <score> ()scoreboard players add <player: target> <objective: string> <count: int> ()
:;Description
::Increments the targets' scores in that objective by the given amount.
:;Arguments
::
::: Specifies the score holders.
::: 
::
::: Specifies the objective.
::: 
::
::: Specifies an amount to add to the score.
::: , a negative number will subtract from the score.
:;Result
::
:;Output
::
=== remove ===
:;Syntax
::scoreboard players remove <targets> <objective> <score> ()scoreboard players remove <player: target> <objective: string> <count: int> ()
:;Description
::Decrements the targets' scores in that objective by the given amount.
:;Arguments
::
::: Specifies the score holders.
::: 
::
::: Specifies the objective.
::: 
::
::: Specifies an amount to subtract from the score.
::: , a negative number will add to the score.
:;Result
::
:;Output
::
=== random ===
:;Syntax
::scoreboard players random <player: target> <objective: string> <min: int> <max: int> ()
:;Description
::Sets the targets' scores in that objective to a random number between min and max (both inclusive).
:;Arguments
::
::: Specifies the score holders.
::: 
::
::: Specifies the objective.
::: Must be either a single word that isn't a number (allowed characters: , , , and ) or a double-quoted string.
::
::: Specifies the min value and max value that the random number is between.
::: 
:;Result
::
:;Output
::
=== reset ===
:;Syntax
::scoreboard players reset <targets> [<objective>] ()scoreboard players reset <player: target> [objective: string] ()
:;Description
::Deletes score or all scores for the targets. If <objective> is specified, then only that objective is cleared. Otherwise, this applies to all objectives.
::Note that this does not merely set the scores to 0: it removes the targets from the scoreboard system (or for the given objective) altogether.
::, this will also disable the target players' ability to use command (on the given objective if specified).
:;Arguments
::
::: Specifies the score holders.
::: 
::
::: Specifies the objective.
::: 
:;Result
::
:;Output
::
=== test ===
:;Syntax
::scoreboard players test <player: target> <objective: string> <min: wildcard int> [<max: wildcard int>] ()
:;Description
::Tests if targets' scores are between min and max (defaults to MAX_INT(2,147,483,647)).
:;Arguments
::
::: Specifies the score holders.
::: 
::
::: Specifies the objective.
::: Must be either a single word that isn't a number (allowed characters: , , , and ) or a double-quoted string.
::
::: Specifies the min value and max value that the random number is between.
::: Must be a 32-bit integer. And 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.
:;Result
::
:;Output
::
=== enable ===
:;Syntax
::scoreboard players enable <targets> <objective> ()
:;Description
::Enables the target(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 command has been run, players can't that objective. Using the command will disable it again.
::Note that if any of the targets did not previously have a score for that scoreboard, this command will set their score to 0.
:;Arguments
::
::: Specifies the score holders.
::: 
::
::: Specifies the objective.
::: 
:;Result
::
:;Output
::
=== operation ===
:;Syntax
::scoreboard players operation <targets> <targetObjective> <operation> <source> <sourceObjective> ()scoreboard players operation <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string> ()
:;Description
::Applies an arithmetic operation altering the targets' scores in the target objective, using sources' scores in the source objective as input.
:;Arguments
::
::: Specifies the target score holders whose scores will be modified.
::: 
::
::: Specifies the objective for targets.
::: 
::
::: Specifies the source score holders whose scores will be used as source inputs.
::: 
::
::: Specifies the objective for sources.
::: 
::
::: Specifies the operation to be applied.
::: 
:::*= Assignment: Set target's score to source's score
:::*+= Addition: Add source's score to target's score
:::*-= Subtraction: Subtract source's score from target's score
:::**= Multiplication: Set target's score to the product of the target's and source's scores
:::*/= Floor division: Divide target's score by source' scores, and the result will be rounded down to an integer.
:::*%= Modulus: Divide target's score by source's score, and use the positive remainder to set the target score
:::* Swapping: swaps target's score and source's score
:::* Choosing minimum: Set target's score to source's score only if source's score is less.
:::* Choosing maximum: Set target's score to source's score only if source's score is bigger.
:::In all cases except , source's score remains unchanged when performing the operation on a target. 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.
:;Result
::
:;Output
::
== History ==
== See also ==
*
*
de:Befehl/scoreboard
es:Comandos/scoreboard
ja:コマンド/scoreboard
ru:Команды консоли/scoreboard
uk:Команди консолі/scoreboard
zh:命令/scoreboard