Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/scoreboard: Difference between revisions

From SAS Gaming Wiki
imported>MinecraftBedrockPlayer7
mNo edit summary
 
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
(One intermediate revision by the same user not shown)
Line 4: Line 4:
* 2{{only|java|short=1}}
* 2{{only|java|short=1}}
* 1{{only|bedrock|short=1}}
* 1{{only|bedrock|short=1}}
|others=[[Minecraft:Cheat]] only{{only|bedrock|short=1}}
|others=Cheat only{{only|bedrock|short=1}}
}}
}}


Manages and displays scores for various [[Minecraft:scoreboard]] objectives.
Manages and displays scores for various scoreboard objectives.


== Objectives commands ==
== Objectives commands ==
=== Syntax ===
=== Syntax ===
: <code>scoreboard objectives '''list'''</code>
: <code>scoreboard objectives '''list'''</code>
:: Lists all existing [[Minecraft:Scoreboard#Objectives|objectives]] with their display names and criteria.
:: Lists all existing objectives with their display names and criteria.
: <code>scoreboard objectives '''add''' <objective> <criteria> [<displayName>]</code> ({{el|java}})
: <code>scoreboard objectives '''add''' <objective> <criteria> [<displayName>]</code> ({{MC/El|java}})
: <code>scoreboard objectives '''add''' <objective: string> dummy [displayName: string]</code> ({{el|bedrock}})
: <code>scoreboard objectives '''add''' <objective: string> dummy [displayName: string]</code> ({{MC/El|bedrock}})
:: Creates a new objective with the given internal objective name, specified criterion, and the optional display name.
:: Creates a new objective with the given internal objective name, specified criterion, and the optional display name.
: <code>scoreboard objectives '''remove''' <objective></code> ({{el|java}})
: <code>scoreboard objectives '''remove''' <objective></code> ({{MC/El|java}})
: <code>scoreboard objectives '''remove''' <objective: string></code> ({{el|bedrock}})
: <code>scoreboard objectives '''remove''' <objective: string></code> ({{MC/El|bedrock}})
:: Deletes 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.
:: Deletes 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.
: <code>scoreboard objectives '''setdisplay''' <slot> [<objective>]</code> ({{el|java}})
: <code>scoreboard objectives '''setdisplay''' <slot> [<objective>]</code> ({{MC/El|java}})
: <code>scoreboard objectives '''setdisplay''' <list|sidebar> [objective: string] [ascending|descending]</code> ({{el|bedrock}})
: <code>scoreboard objectives '''setdisplay''' <list|sidebar> [objective: string] [ascending|descending]</code> ({{MC/El|bedrock}})
: <code>scoreboard objectives '''setdisplay''' belowname [objective: string]</code> ({{el|bedrock}})
: <code>scoreboard objectives '''setdisplay''' belowname [objective: string]</code> ({{MC/El|bedrock}})
:: Displays 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). {{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.
:: Displays 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). {{MC/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.
: <code>scoreboard objectives '''modify''' <objective> '''displayautoupdate''' <value></code> ({{el|java}})
: <code>scoreboard objectives '''modify''' <objective> '''displayautoupdate''' <value></code> ({{MC/El|java}})
:: Changes whether or not display names are automatically updated on every score update.
:: Changes whether or not display names are automatically updated on every score update.
: <code>scoreboard objectives '''modify''' <objective> '''displayname''' <displayName></code> ({{el|java}})
: <code>scoreboard objectives '''modify''' <objective> '''displayname''' <displayName></code> ({{MC/El|java}})
:: Changes the display name of the scoreboard in display slots.
:: Changes the display name of the scoreboard in display slots.
: <code>scoreboard objectives '''modify''' <objective> '''numberformat'''</code> ({{el|java}})
: <code>scoreboard objectives '''modify''' <objective> '''numberformat'''</code> ({{MC/El|java}})
:: Resets the default number format of the scoreboard in display slots and in score text components.
:: Resets the default number format of the scoreboard in display slots and in score text components.
: <code>scoreboard objectives '''modify''' <objective> '''numberformat blank'''</code> ({{el|java}})
: <code>scoreboard objectives '''modify''' <objective> '''numberformat blank'''</code> ({{MC/El|java}})
:: Sets the default number format to blank, which indicates that the score is not shown.
:: Sets the default number format to blank, which indicates that the score is not shown.
: <code>scoreboard objectives '''modify''' <objective> '''numberformat fixed''' <component></code> ({{el|java}})
: <code>scoreboard objectives '''modify''' <objective> '''numberformat fixed''' <component></code> ({{MC/El|java}})
:: Sets the default number format to fixed, which indicates that the score is replaced by the text component.
:: Sets the default number format to fixed, which indicates that the score is replaced by the text component.
: <code>scoreboard objectives '''modify''' <objective> '''numberformat styled''' <style></code> ({{el|java}})
: <code>scoreboard objectives '''modify''' <objective> '''numberformat styled''' <style></code> ({{MC/El|java}})
:: Sets the default number format to styled, which indicates that the score is displayed with the selected style.
:: Sets the default number format to styled, which indicates that the score is displayed with the selected style.
: <code>scoreboard objectives '''modify''' <objective> '''rendertype''' (hearts<nowiki>|</nowiki>integer)</code> ({{el|java}})
: <code>scoreboard objectives '''modify''' <objective> '''rendertype''' (hearts<nowiki>|</nowiki>integer)</code> ({{MC/El|java}})
:: Changes the display format for scores in the tab player list.
:: Changes the display format for scores in the tab player list.


=== Arguments ===
=== Arguments ===
{{argument|objective|objective|objective: string|basic_string}}
{{MC/Argument|objective|objective|objective: string|basic_string}}
: Specifies the internal objective name.
: Specifies the internal objective name.
: {{arg desc|je=objective|be=basic_string}}
: {{MC/Arg desc|je=objective|be=basic_string}}


{{argument|criteria|objective_criteria|dummy}}
{{MC/Argument|criteria|objective_criteria|dummy}}
: Specifies the criterion of the new objective.
: Specifies the criterion of the new objective.
: {{arg desc|je=objective_criteria}} {{IN|bedrock}}, "dummy" is the only criterion currently supported
: {{MC/Arg desc|je=objective_criteria}} {{MC/In|bedrock}}, "dummy" is the only criterion currently supported


{{argument|displayName|component|displayName: string|basic_string}}
{{MC/Argument|displayName|component|displayName: string|basic_string}}
: Specifies the display name, defaulting to <code><objective></code> when unspecified.
: Specifies the display name, defaulting to <code><objective></code> when unspecified.
: {{IN|java}}, must be a [[Minecraft:raw JSON text]]. {{IN|bedrock}}, it must be either a single word that isn't a number (allowed characters: {{cd|-|:|.|_|delimiter=,&#32;}}, {{cd|A|Z|delimiter=-}}, {{cd|a|z|delimiter=-}}, and {{cd|0|9|delimiter=-}}) or a double-quoted string.
: {{MC/In|java}}, must be a raw JSON text. {{MC/In|bedrock}}, it must be either a single word that isn't a number (allowed characters: {{MC/Cd|-|:|.|_|delimiter=,&#32;}}, {{MC/Cd|A|Z|delimiter=-}}, {{MC/Cd|a|z|delimiter=-}}, and {{MC/Cd|0|9|delimiter=-}}) or a double-quoted string.


{{argument|slot|scoreboard_slot|<nowiki>list|sidebar|belowname</nowiki>}}
{{MC/Argument|slot|scoreboard_slot|<nowiki>list|sidebar|belowname</nowiki>}}
: Specifies the slot to display the objective.
: Specifies the slot to display the objective.
: {{arg desc|je=scoreboard_slot}} Valid slots are listed and described in [[Minecraft:Scoreboard#Display_slots|Display Slots]].
: {{MC/Arg desc|je=scoreboard_slot}} Valid slots are listed and described in Display Slots.
: {{arg desc|je=objective|be=basic_string}}
: {{MC/Arg desc|je=objective|be=basic_string}}


{{el|be|short=1}}: <code>ascending|descending</code>
{{MC/El|be|short=1}}: <code>ascending|descending</code>
: Specifies the sort order.
: Specifies the sort order.


{{el|je|short=1}}: {{argument|value|bool}}
{{MC/El|je|short=1}}: {{MC/Argument|value|bool}}
: Specifies whether display names are auto-updated.
: Specifies whether display names are auto-updated.
: {{arg desc|je=bool}}
: {{MC/Arg desc|je=bool}}


{{el|je|short=1}}: {{argument|displayName|component}}
{{MC/El|je|short=1}}: {{MC/Argument|displayName|component}}
: Specifies the display name.
: Specifies the display name.
: {{arg desc|je=component}}
: {{MC/Arg desc|je=component}}


{{el|je|short=1}}: {{argument|component|component}}
{{MC/El|je|short=1}}: {{MC/Argument|component|component}}
: Specifies display text.
: Specifies display text.
: {{arg desc|je=component}}
: {{MC/Arg desc|je=component}}


{{el|je|short=1}}: {{argument|style|style}}
{{MC/El|je|short=1}}: {{MC/Argument|style|style}}
: Specifies the style.
: Specifies the style.
: {{arg_desc|je=style}}
: {{arg_desc|je=style}}


{{el|je|short=1}}: <code>hearts|integer</code>
{{MC/El|je|short=1}}: <code>hearts|integer</code>
: Specifies the format.
: Specifies the format.


Line 90: Line 90:


=== Output ===
=== Output ===
{{Output table}}
{{MC/Output table}}
{{Output table|edition=je|cmd=... list|On success|1|1|the number of objectives in scoreboard system}}
{{MC/Output table|edition=je|cmd=... list|On success|1|1|the number of objectives in scoreboard system}}
{{Output table|cmd=... add ...<br>... remove ...|On success|1|1|the number of objectives in scoreboard system after execution}}
{{MC/Output table|cmd=... add ...<br>... remove ...|On success|1|1|the number of objectives in scoreboard system after execution}}
{{Output table|cmd=|On success|1|1|0}}
{{MC/Output table|cmd=|On success|1|1|0}}
{{Output table|edition=be|cmd=|On success|the number of objectives in scoreboard system}}
{{MC/Output table|edition=be|cmd=|On success|the number of objectives in scoreboard system}}
{{Output table}}
{{MC/Output table}}


== Players commands ==
== Players commands ==
=== Syntax ===
=== Syntax ===
: <code>scoreboard players '''list''' [<target>]</code> ({{el|java}})
: <code>scoreboard players '''list''' [<target>]</code> ({{MC/El|java}})
: <code>scoreboard players '''list''' [playername: target]</code> ({{el|bedrock}})
: <code>scoreboard players '''list''' [playername: target]</code> ({{MC/El|bedrock}})
:: Lists all [[Minecraft:Scoreboard#Objectives|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.
:: 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.
: <code>scoreboard players '''get''' <target> <objective></code> ({{el|java}})
: <code>scoreboard players '''get''' <target> <objective></code> ({{MC/El|java}})
:: Return the scoreboard value. Can be used in conjunction with the {{cmd|execute}} command: {{cmd|execute store result ... run scoreboard players get ...}}
:: Return the scoreboard value. Can be used in conjunction with the {{MC/Cmd|execute}} command: {{MC/Cmd|execute store result ... run scoreboard players get ...}}
: <code>scoreboard players '''set''' <targets> <objective> &lt;score></code> ({{el|java}})
: <code>scoreboard players '''set''' <targets> <objective> &lt;score></code> ({{MC/El|java}})
:<code>scoreboard players '''set''' <player: target> <objective: string> <count: int></code> ({{el|bedrock}})
:<code>scoreboard players '''set''' <player: target> <objective: string> <count: int></code> ({{MC/El|bedrock}})
:: Set the targets' scores in the given objective, overwriting any previous score.
:: Set the targets' scores in the given objective, overwriting any previous score.
: <code>scoreboard players '''add''' <targets> <objective> &lt;score></code> ({{el|java}})
: <code>scoreboard players '''add''' <targets> <objective> &lt;score></code> ({{MC/El|java}})
: <code>scoreboard players '''add''' <player: target> <objective: string> <count: int></code> ({{el|bedrock}})
: <code>scoreboard players '''add''' <player: target> <objective: string> <count: int></code> ({{MC/El|bedrock}})
:: Increments the targets' scores in that objective by the given amount. {{IN|bedrock}}, a negative count subtracts from the score.
:: Increments the targets' scores in that objective by the given amount. {{MC/In|bedrock}}, a negative count subtracts from the score.
: <code>scoreboard players '''remove''' <targets> <objective> &lt;score></code> ({{el|java}})
: <code>scoreboard players '''remove''' <targets> <objective> &lt;score></code> ({{MC/El|java}})
: <code>scoreboard players '''remove''' <player: target> <objective: string> <count: int></code> ({{el|bedrock}})
: <code>scoreboard players '''remove''' <player: target> <objective: string> <count: int></code> ({{MC/El|bedrock}})
:: Decrements the targets' scores in that objective by the given amount. {{IN|bedrock}}, a negative number adds to the score.
:: Decrements the targets' scores in that objective by the given amount. {{MC/In|bedrock}}, a negative number adds to the score.
: <code>scoreboard players '''random''' <player: target> <objective: string> <min: int> <max: int></code> ({{el|bedrock}})
: <code>scoreboard players '''random''' <player: target> <objective: string> <min: int> <max: int></code> ({{MC/El|bedrock}})
:: Sets the targets' scores in that objective to a random number between min and max (both inclusive).
:: Sets the targets' scores in that objective to a random number between min and max (both inclusive).
: <code>scoreboard players '''reset''' <targets> [<objective>]</code> ({{el|java}})
: <code>scoreboard players '''reset''' <targets> [<objective>]</code> ({{MC/El|java}})
: <code>scoreboard players '''reset''' <player: target> [objective: string]</code> ({{el|bedrock}})
: <code>scoreboard players '''reset''' <player: target> [objective: string]</code> ({{MC/El|bedrock}})
:: Deletes score or all scores for the targets. If <code><objective></code> is specified, then only that objective is cleared. Otherwise, this applies to all objectives.
:: Deletes score or all scores for the targets. 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 scores to 0: it removes the targets from the scoreboard system (or for the given objective) altogether.
:: 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.
:: {{IN|java}}, this also disables the target players' ability to use {{cmd|trigger}} command (on the given objective if specified).
:: {{MC/In|java}}, this also disables the target players' ability to use {{MC/Cmd|trigger}} command (on the given objective if specified).
:: {{IN|java}}, running <code>scoreboard players reset *</code> will reset the scores of all players, while <code>scoreboard players reset @a</code> will only reset the scores of players online.
:: {{MC/In|java}}, running <code>scoreboard players reset *</code> will reset the scores of all players, while <code>scoreboard players reset @a</code> will only reset the scores of players online.
: <code>scoreboard players '''test''' <player: target> <objective: string> <min: wildcard int> [<max: wildcard int>]</code> ({{el|bedrock}})
: <code>scoreboard players '''test''' <player: target> <objective: string> <min: wildcard int> [<max: wildcard int>]</code> ({{MC/El|bedrock}})
:: Tests if targets' scores are between min and max (defaults to MAX_INT(2,147,483,647)).
:: Tests if targets' scores are between min and max (defaults to MAX_INT(2,147,483,647)).
: <code>scoreboard players '''enable''' <targets> <objective></code> ({{el|java}})
: <code>scoreboard players '''enable''' <targets> <objective></code> ({{MC/El|java}})
:: Enables the target(s) to use the {{cmd|trigger}} command on the specified objective. This command accepts non-player entities, but only players are able to actually use the {{cmd|trigger}} command. Until this command has been run, players can't trigger that objective. Using the {{cmd|trigger}} command disables it again.
:: Enables the target(s) to use the {{MC/Cmd|trigger}} command on the specified objective. This command accepts non-player entities, but only players are able to actually use the {{MC/Cmd|trigger}} command. Until this command has been run, players can't trigger that objective. Using the {{MC/Cmd|trigger}} command disables it again.
:: Note that if any of the targets did not previously have a score for that scoreboard, this command sets their score to 0.
:: Note that if any of the targets did not previously have a score for that scoreboard, this command sets their score to 0.
: <code>scoreboard players '''operation''' <targets> <targetObjective> <operation> &lt;source> <sourceObjective></code> ({{el|java}})
: <code>scoreboard players '''operation''' <targets> <targetObjective> <operation> &lt;source> <sourceObjective></code> ({{MC/El|java}})
: <code>scoreboard players '''operation''' <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string></code> ({{el|bedrock}})
: <code>scoreboard players '''operation''' <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string></code> ({{MC/El|bedrock}})
:: Applies an arithmetic operation altering the targets' scores in the target objective, using sources' scores in the source objective as input.
:: Applies an arithmetic operation altering the targets' scores in the target objective, using sources' scores in the source objective as input.
: <code>scoreboard players '''display name''' <targets> <objective></code> ({{el|java}})
: <code>scoreboard players '''display name''' <targets> <objective></code> ({{MC/El|java}})
:: Resets the display name of the targets' scores.
:: Resets the display name of the targets' scores.
: <code>scoreboard players '''display name''' <targets> <objective> <text></code> ({{el|java}})
: <code>scoreboard players '''display name''' <targets> <objective> <text></code> ({{MC/El|java}})
:: Changes the display name of the targets' scores.
:: Changes the display name of the targets' scores.
: <code>scoreboard players '''display numberformat''' <targets> <objective></code> ({{el|java}})
: <code>scoreboard players '''display numberformat''' <targets> <objective></code> ({{MC/El|java}})
:: Resets the number format of the targets' scores.
:: Resets the number format of the targets' scores.
: <code>scoreboard players '''display numberformat''' <targets> <objective> '''blank'''</code> ({{el|java}})
: <code>scoreboard players '''display numberformat''' <targets> <objective> '''blank'''</code> ({{MC/El|java}})
:: Sets the number format of the targets' scores to blank, which indicates that the score is not shown.
:: Sets the number format of the targets' scores to blank, which indicates that the score is not shown.
: <code>scoreboard players '''display numberformat''' <targets> <objective> '''fixed''' <contents></code> ({{el|java}})
: <code>scoreboard players '''display numberformat''' <targets> <objective> '''fixed''' <contents></code> ({{MC/El|java}})
:: Sets the number format of the targets' scores to fixed, which indicates that the score is replaced by the text component.
:: Sets the number format of the targets' scores to fixed, which indicates that the score is replaced by the text component.
: <code>scoreboard players '''display numberformat''' <targets> <objective> '''styled''' <style></code> ({{el|java}})
: <code>scoreboard players '''display numberformat''' <targets> <objective> '''styled''' <style></code> ({{MC/El|java}})
:: Sets the number format of the targets' scores to styled, which indicates that the score is displayed with the selected style.
:: Sets the number format of the targets' scores to styled, which indicates that the score is displayed with the selected style.


=== Arguments ===
=== Arguments ===
{{argument|target|score_holder|playername: target|WildcardCommandSelector<Actor>}}
{{MC/Argument|target|score_holder|playername: target|WildcardCommandSelector<Actor>}}
: Specifies the score holder.
: Specifies the score holder.
: {{arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}}
: {{MC/Arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}}
: {{IN|java}}, only a single score holder can be specified, and <code>*</code> only works for <code>scoreboard players reset</code> ({{bug|MC-136858}}). {{IN|bedrock}}, multiple score holders can be specified.
: {{MC/In|java}}, only a single score holder can be specified, and <code>*</code> only works for <code>scoreboard players reset</code> ({{bug|MC-136858}}). {{MC/In|bedrock}}, multiple score holders can be specified.


{{argument|targets|score_holder|player: target|WildcardCommandSelector<Actor>}}
{{MC/Argument|targets|score_holder|player: target|WildcardCommandSelector<Actor>}}
: Specifies the score holders.
: Specifies the score holders.
: {{arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}}
: {{MC/Arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}}


{{argument|objective|objective|objective: string|basic_string}}
{{MC/Argument|objective|objective|objective: string|basic_string}}
: Specifies the internal objective name.
: Specifies the internal objective name.
: {{arg desc|je=objective|be=basic_string}}
: {{MC/Arg desc|je=objective|be=basic_string}}


{{argument|score|integer|count: int|int}}
{{MC/Argument|score|integer|count: int|int}}
: Specifies the new score, an amount to add to the score, or an amount to subtract from the score.
: Specifies the new score, an amount to add to the score, or an amount to subtract from the score.
: {{arg desc|je=integer|be=int}}
: {{MC/Arg desc|je=integer|be=int}}


{{el|be|short=1}}: {{argument|min: int|int}}<br>{{el|be|short=1}}: {{argument|max: int|int}}
{{MC/El|be|short=1}}: {{MC/Argument|min: int|int}}<br>{{MC/El|be|short=1}}: {{MC/Argument|max: int|int}}
: Specifies the min value and max value that the random number is between.
: Specifies the min value and max value that the random number is between.
: {{arg desc|be=int}}
: {{MC/Arg desc|be=int}}


{{el|be|short=1}}: {{argument|min: wildcard int|CommandWildcardInt}}<br>{{el|be|short=1}}: {{argument|max: wildcard int|int}}
{{MC/El|be|short=1}}: {{MC/Argument|min: wildcard int|CommandWildcardInt}}<br>{{MC/El|be|short=1}}: {{MC/Argument|max: wildcard int|int}}
: Specifies the min value and max value that the random number is between.
: Specifies the min value and max value that the random number is between.
: Must be a 32-bit integer. And <code>min: wildcard int</code> can be replaced with asterisk (*) to represent -2,147,483,648, and <code>max: wildcard</code> int can be replaced with asterisk (*) to represent 2,147,483,647.
: Must be a 32-bit integer. And <code>min: wildcard int</code> can be replaced with asterisk (*) to represent -2,147,483,648, and <code>max: wildcard</code> int can be replaced with asterisk (*) to represent 2,147,483,647.


{{argument|targetObjective|objective|targetObjective: string|basic_string}}
{{MC/Argument|targetObjective|objective|targetObjective: string|basic_string}}
: Specifies the objective for targets.
: Specifies the objective for targets.
: {{arg desc|je=objective|be=basic_string}}
: {{MC/Arg desc|je=objective|be=basic_string}}


{{argument|source|score_holder|selector: target|WildcardCommandSelector<Actor>}}
{{MC/Argument|source|score_holder|selector: target|WildcardCommandSelector<Actor>}}
: Specifies the source score holders whose scores are used as source inputs.
: Specifies the source score holders whose scores are used as source inputs.
: {{arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}}
: {{MC/Arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}}


{{argument|sourceObjective|objective|objective: string|basic_string}}
{{MC/Argument|sourceObjective|objective|objective: string|basic_string}}
: Specifies the objective for sources.
: Specifies the objective for sources.
: {{arg desc|je=objective|be=basic_string}}
: {{MC/Arg desc|je=objective|be=basic_string}}


{{argument|operation|operation|operation: operator|CommandOperator}}
{{MC/Argument|operation|operation|operation: operator|CommandOperator}}
: Specifies the operation to be applied.
: Specifies the operation to be applied.
: {{arg desc|je=operation|be=CommandOperator}}
: {{MC/Arg desc|je=operation|be=CommandOperator}}
:* <code>=</code> Assignment: Set target's score to source's score
:* <code>=</code> Assignment: Set target's score to source's score
:* <code>+=</code> Addition: Add source's score to target's score
:* <code>+=</code> Addition: Add source's score to target's score
Line 189: Line 189:
:* <code>/=</code> Floor division: Divide target's score by source' scores, and the result is rounded down to an integer.
:* <code>/=</code> Floor division: Divide target's score by source' scores, and the result is rounded down to an integer.
:* <code>%=</code> Modulus: Divide target's score by source's score, and use the positive remainder to set the target score
:* <code>%=</code> Modulus: Divide target's score by source's score, and use the positive remainder to set the target score
:* {{cd|><}} Swapping: swaps target's score and source's score
:* {{MC/Cd|><}} Swapping: swaps target's score and source's score
:* {{cd|<}} Choosing minimum: Set target's score to source's score only if source's score is less.
:* {{MC/Cd|<}} Choosing minimum: Set target's score to source's score only if source's score is less.
:* {{cd|>}} Choosing maximum: Set target's score to source's score only if source's score is bigger.
:* {{MC/Cd|>}} Choosing maximum: Set target's score to source's score only if source's score is bigger.
: In all cases except {{cd|><}}, source's score remains unchanged when performing the operation on a target. 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.
: In all cases except {{MC/Cd|><}}, source's score remains unchanged when performing the operation on a target. 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.
: For <code>/=</code> and <code>%=</code>, if source's score is 0, the command fails {{in|java}}, or succeeds but does not change target's score {{in|bedrock}}.
: For <code>/=</code> and <code>%=</code>, if source's score is 0, the command fails {{MC/In|java}}, or succeeds but does not change target's score {{MC/In|bedrock}}.


{{el|je|short=1}}: {{argument|text|component}}
{{MC/El|je|short=1}}: {{MC/Argument|text|component}}
: Specifies the display name.
: Specifies the display name.
: {{arg desc|je=component}}
: {{MC/Arg desc|je=component}}


{{el|je|short=1}}: {{argument|contents|component}}
{{MC/El|je|short=1}}: {{MC/Argument|contents|component}}
: Specifies display text.
: Specifies display text.
: {{arg desc|je=component}}
: {{MC/Arg desc|je=component}}


{{el|je|short=1}}: {{argument|style|style}}
{{MC/El|je|short=1}}: {{MC/Argument|style|style}}
: Specifies the style.
: Specifies the style.
: {{arg_desc|je=style}}
: {{arg_desc|je=style}}
Line 234: Line 234:


=== Output ===
=== Output ===
{{Output table}}
{{MC/Output table}}
{{Output table|edition=je|cmd=... list <targets>|On success|1|1|the number of tracking objectives of the specified score holder}}
{{MC/Output table|edition=je|cmd=... list <targets>|On success|1|1|the number of tracking objectives of the specified score holder}}
{{Output table|cmd=... get ...|On success|1|1|the score's value}}
{{MC/Output table|cmd=... get ...|On success|1|1|the score's value}}
{{Output table|cmd=... set ...|On success|1|1|the number of targets multiplied by the specified score}}
{{MC/Output table|cmd=... set ...|On success|1|1|the number of targets multiplied by the specified score}}
{{Output table|cmd=... add ...<br>... remove ...|On success|1|1|the sum of the objective's score value of each target after execution}}
{{MC/Output table|cmd=... add ...<br>... remove ...|On success|1|1|the sum of the objective's score value of each target after execution}}
{{Output table|cmd=... reset ...|On success|1|1|the number of the targets}}
{{MC/Output table|cmd=... reset ...|On success|1|1|the number of the targets}}
{{Output table|cmd=... enable ...|On success|1|1|the number of the targets whose scores are newly enabled}}
{{MC/Output table|cmd=... enable ...|On success|1|1|the number of the targets whose scores are newly enabled}}
{{Output table|cmd=... operation ...|On success|1|1|the sum of the objective's score value of each target after the operation on it}}
{{MC/Output table|cmd=... operation ...|On success|1|1|the sum of the objective's score value of each target after the operation on it}}
{{Output table|cmd=|On success|1|1|0}}
{{MC/Output table|cmd=|On success|1|1|0}}
{{Output table|edition=be|cmd=... list|On success|the number of score holders}}
{{MC/Output table|edition=be|cmd=... list|On success|the number of score holders}}
{{Output table|cmd=... list [playername: target]|On success|the total number of tracking objectives of each score holder}}
{{MC/Output table|cmd=... list [playername: target]|On success|the total number of tracking objectives of each score holder}}
{{Output table|cmd=... set ...<br>... add ...<br>... remove ...<br>... random ...|On success|1}}
{{MC/Output table|cmd=... set ...<br>... add ...<br>... remove ...<br>... random ...|On success|1}}
{{Output table|cmd=... reset ...|On success|the number of the targets that is tracked by the scoreboard (or the specified objective)}}
{{MC/Output table|cmd=... reset ...|On success|the number of the targets that is tracked by the scoreboard (or the specified objective)}}
{{Output table|cmd=... test ...|On success|the number of the specified score holders whose score is between min and max}}
{{MC/Output table|cmd=... test ...|On success|the number of the specified score holders whose score is between min and max}}
{{Output table|cmd=... operation ...|On success|1}}
{{MC/Output table|cmd=... operation ...|On success|1}}
{{Output table}}
{{MC/Output table}}


== History ==
== History ==
=== ''Java Edition'' ===
=== ''Java Edition'' ===
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||1.5|dev=13w04a|Added {{cmd|scoreboard|link=none}}.}}
|{{HistoryLine||1.5|dev=13w04a|Added {{MC/Cmd|scoreboard|link=none}}.}}
|{{HistoryLine||1.13|dev=17w45a|Split teams usage to {{cmd|team}} and tags usage to {{cmd|tag}}. <code>/scoreboard players test</code> removed in favor of <code>/execute (if/unless) score</code>.}}
|{{HistoryLine||1.13|dev=17w45a|Split teams usage to {{MC/Cmd|team}} and tags usage to {{MC/Cmd|tag}}. <code>/scoreboard players test</code> removed in favor of <code>/execute (if/unless) score</code>.}}
|{{HistoryLine|||dev=pre7|Added {{cmd|scoreboard objectives modify <''objectiveName''> displayname <''displayName''>|link=none}}.}}
|{{HistoryLine|||dev=pre7|Added {{MC/Cmd|scoreboard objectives modify <''objectiveName''> displayname <''displayName''>|link=none}}.}}
|{{HistoryLine|||dev=pre8|Added {{cmd|scoreboard objectives modify <''objectiveName''> rendertype ''hearts''|link=none}}, which makes health bars display as hearts, like this: {{Healthbar|12}}.
|{{HistoryLine|||dev=pre8|Added {{MC/Cmd|scoreboard objectives modify <''objectiveName''> rendertype ''hearts''|link=none}}, which makes health bars display as hearts, like this: {{MC/Healthbar|12}}.
|Added {{cmd|scoreboard objectives modify <objectiveName> rendertype ''integer''|link=none}}, which makes health bars display as yellow numbers.
|Added {{MC/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.}}
|Objective names are now text components, not raw strings.}}
|{{HistoryLine||1.18|dev=21w37a|Removed length limits for scoreboards, score holders and team names.}}
|{{MC/HistoryLine||1.18|dev=21w37a|Removed length limits for scoreboards, score holders and team names.}}
|{{HistoryLine||1.20.2|dev=23w31a|Renamed the display slot argument <code>belowName</code> to <code>below_name</code>.}}
|{{MC/HistoryLine||1.20.2|dev=23w31a|Renamed the display slot argument <code>belowName</code> to <code>below_name</code>.}}
|{{HistoryLine||1.20.3|dev=23w46a|Added new subcommands for changing the display of specific scoreboard entries in the sidebar.}}
|{{MC/HistoryLine||1.20.3|dev=23w46a|Added new subcommands for changing the display of specific scoreboard entries in the sidebar.}}
|{{HistoryLine||1.21.5|dev=25w02a|Text style in the {{cmd|scoreboard}} command when specifying the styled number format is now specified with SNBT instead of JSON.}}
|{{HistoryLine||1.21.5|dev=25w02a|Text style in the {{MC/Cmd|scoreboard}} command when specifying the styled number format is now specified with SNBT instead of JSON.}}
|{{HistoryLine|||dev=25w05a|Text component arguments are now resolved before use in context of entity held in {{cd|@s}}.}}
|{{HistoryLine|||dev=25w05a|Text component arguments are now resolved before use in context of entity held in {{MC/Cd|@s}}.}}
}}
}}


=== ''Bedrock Edition'' ===
=== ''Bedrock Edition'' ===
{{HistoryTable
{{HistoryTable
|{{HistoryLine|bedrock}}
|{{MC/HistoryLine|bedrock}}
|{{HistoryLine||1.7.0|dev=beta 1.7.0.2|Added {{cmd|scoreboard|link=none}}.}}
|{{HistoryLine||1.7.0|dev=beta 1.7.0.2|Added {{MC/Cmd|scoreboard|link=none}}.}}
}}
}}


== See also ==
== See also ==
*{{cmd|team}}
*{{MC/Cmd|team}}
*{{cmd|tag}}
*{{MC/Cmd|tag}}
*{{cmd|random}}
*{{MC/Cmd|random}}


== External links ==
== External links ==
Line 284: Line 284:


== Navigation ==
== Navigation ==
{{Navbox commands}}
{{MC/Navbox commands}}


[[Minecraft:de:Befehl/scoreboard]]
de:Befehl/scoreboard
[[Minecraft:es:Comandos/scoreboard]]
es:Comandos/scoreboard
[[Minecraft:ja:コマンド/scoreboard]]
ja:コマンド/scoreboard
[[Minecraft:pt:Comandos/scoreboard]]
pt:Comandos/scoreboard
[[Minecraft:ru:Команды консоли/scoreboard]]
ru:Команды консоли/scoreboard
[[Minecraft:uk:Команди консолі/scoreboard]]
uk:Команди консолі/scoreboard
[[Minecraft:zh:命令/scoreboard]]
zh:命令/scoreboard

Latest revision as of 20:13, 9 April 2026

Template:Infobox command

Manages and displays scores for various scoreboard objectives.

Objectives commands

Syntax

scoreboard objectives list
Lists all existing objectives with their display names and criteria.
scoreboard objectives add <objective> <criteria> [<displayName>] (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard objectives add <objective: string> dummy [displayName: string] (
  1. REDIRECT Template:Edition

Template:Rcat)

Creates a new objective with the given internal objective name, specified criterion, and the optional display name.
scoreboard objectives remove <objective> (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard objectives remove <objective: string> (
  1. REDIRECT Template:Edition

Template:Rcat)

Deletes 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.
scoreboard objectives setdisplay <slot> [<objective>] (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard objectives setdisplay <list|sidebar> [objective: string] [ascending|descending] (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard objectives setdisplay belowname [objective: string] (
  1. REDIRECT Template:Edition

Template:Rcat)

Displays 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). in Template:Editions, if slot is list or sidebar, there is an additional optional argument ascending|descending to specify the sort order.
scoreboard objectives modify <objective> displayautoupdate <value> (
  1. REDIRECT Template:Edition

Template:Rcat)

Changes whether or not display names are automatically updated on every score update.
scoreboard objectives modify <objective> displayname <displayName> (
  1. REDIRECT Template:Edition

Template:Rcat)

Changes the display name of the scoreboard in display slots.
scoreboard objectives modify <objective> numberformat (
  1. REDIRECT Template:Edition

Template:Rcat)

Resets the default number format of the scoreboard in display slots and in score text components.
scoreboard objectives modify <objective> numberformat blank (
  1. REDIRECT Template:Edition

Template:Rcat)

Sets the default number format to blank, which indicates that the score is not shown.
scoreboard objectives modify <objective> numberformat fixed <component> (
  1. REDIRECT Template:Edition

Template:Rcat)

Sets the default number format to fixed, which indicates that the score is replaced by the text component.
scoreboard objectives modify <objective> numberformat styled <style> (
  1. REDIRECT Template:Edition

Template:Rcat)

Sets the default number format to styled, which indicates that the score is displayed with the selected style.
scoreboard objectives modify <objective> rendertype (hearts|integer) (
  1. REDIRECT Template:Edition

Template:Rcat)

Changes the display format for scores in the tab player list.

Arguments

Template:El<objective>: objective
Template:El: objective: string: basic_string

Specifies the internal objective name.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|objective}}{{#vardefine:be-arg|string}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:El<criteria>: objective_criteria
Template:El: dummy

Specifies the criterion of the new objective.
{{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|objective_criteria}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} in Template:Editions, "dummy" is the only criterion currently supported

Template:El<displayName>: component
Template:El: displayName: string: basic_string

Specifies the display name, defaulting to <objective> when unspecified.
in Template:Editions, must be a raw JSON text. in Template:Editions, it must be either a single word that isn't a number (allowed characters:
  1. REDIRECT Template:Code

Template:Redr,

  1. REDIRECT Template:Code

Template:Redr,

  1. REDIRECT Template:Code

Template:Redr, and

  1. REDIRECT Template:Code

Template:Redr) or a double-quoted string.

Template:El<slot>: scoreboard_slot
Template:El: list|sidebar|belowname

Specifies the slot to display the objective.
{{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|scoreboard_slot}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} Valid slots are listed and described in Display Slots.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|objective}}{{#vardefine:be-arg|string}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: ascending|descending

Specifies the sort order.
  1. REDIRECT Template:Edition

Template:Rcat: <value>: bool

Specifies whether display names are auto-updated.
{{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|bool}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <displayName>: component

Specifies the display name.
{{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|component}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <component>: component

Specifies display text.
{{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|component}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <style>: style

Specifies the style.
Template:Arg desc
  1. REDIRECT Template:Edition

Template:Rcat: hearts|integer

Specifies the format.

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of objectives in scoreboard system}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... list}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of objectives in scoreboard system after execution}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... add ...
... remove ...
}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|Any}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the number of objectives in scoreboard system}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|Any}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

Players commands

Syntax

scoreboard players list [<target>] (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard players list [playername: target] (
  1. REDIRECT Template:Edition

Template:Rcat)

Lists all score holders that 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> (
  1. REDIRECT Template:Edition

Template:Rcat)

Return the scoreboard value. Can be used in conjunction with the
  1. REDIRECT Template:Command

Template:Redr command:

  1. REDIRECT Template:Command

Template:Redr

scoreboard players set <targets> <objective> <score> (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard players set <player: target> <objective: string> <count: int> (
  1. REDIRECT Template:Edition

Template:Rcat)

Set the targets' scores in the given objective, overwriting any previous score.
scoreboard players add <targets> <objective> <score> (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard players add <player: target> <objective: string> <count: int> (
  1. REDIRECT Template:Edition

Template:Rcat)

Increments the targets' scores in that objective by the given amount. in Template:Editions, a negative count subtracts from the score.
scoreboard players remove <targets> <objective> <score> (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard players remove <player: target> <objective: string> <count: int> (
  1. REDIRECT Template:Edition

Template:Rcat)

Decrements the targets' scores in that objective by the given amount. in Template:Editions, a negative number adds to the score.
scoreboard players random <player: target> <objective: string> <min: int> <max: int> (
  1. REDIRECT Template:Edition

Template:Rcat)

Sets the targets' scores in that objective to a random number between min and max (both inclusive).
scoreboard players reset <targets> [<objective>] (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard players reset <player: target> [objective: string] (
  1. REDIRECT Template:Edition

Template:Rcat)

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.
in Template:Editions, this also disables the target players' ability to use
  1. REDIRECT Template:Command

Template:Redr command (on the given objective if specified).

in Template:Editions, running scoreboard players reset * will reset the scores of all players, while scoreboard players reset @a will only reset the scores of players online.
scoreboard players test <player: target> <objective: string> <min: wildcard int> [<max: wildcard int>] (
  1. REDIRECT Template:Edition

Template:Rcat)

Tests if targets' scores are between min and max (defaults to MAX_INT(2,147,483,647)).
scoreboard players enable <targets> <objective> (
  1. REDIRECT Template:Edition

Template:Rcat)

Enables the target(s) to use the
  1. REDIRECT Template:Command

Template:Redr command on the specified objective. This command accepts non-player entities, but only players are able to actually use the

  1. REDIRECT Template:Command

Template:Redr command. Until this command has been run, players can't trigger that objective. Using the

  1. REDIRECT Template:Command

Template:Redr command disables it again.

Note that if any of the targets did not previously have a score for that scoreboard, this command sets their score to 0.
scoreboard players operation <targets> <targetObjective> <operation> <source> <sourceObjective> (
  1. REDIRECT Template:Edition

Template:Rcat)

scoreboard players operation <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string> (
  1. REDIRECT Template:Edition

Template:Rcat)

Applies an arithmetic operation altering the targets' scores in the target objective, using sources' scores in the source objective as input.
scoreboard players display name <targets> <objective> (
  1. REDIRECT Template:Edition

Template:Rcat)

Resets the display name of the targets' scores.
scoreboard players display name <targets> <objective> <text> (
  1. REDIRECT Template:Edition

Template:Rcat)

Changes the display name of the targets' scores.
scoreboard players display numberformat <targets> <objective> (
  1. REDIRECT Template:Edition

Template:Rcat)

Resets the number format of the targets' scores.
scoreboard players display numberformat <targets> <objective> blank (
  1. REDIRECT Template:Edition

Template:Rcat)

Sets the number format of the targets' scores to blank, which indicates that the score is not shown.
scoreboard players display numberformat <targets> <objective> fixed <contents> (
  1. REDIRECT Template:Edition

Template:Rcat)

Sets the number format of the targets' scores to fixed, which indicates that the score is replaced by the text component.
scoreboard players display numberformat <targets> <objective> styled <style> (
  1. REDIRECT Template:Edition

Template:Rcat)

Sets the number format of the targets' scores to styled, which indicates that the score is displayed with the selected style.

Arguments

Template:El<target>: score_holder
Template:El: playername: target: WildcardCommandSelector<Actor>

Specifies the score holder.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|score_holder}}{{#vardefine:be-arg|score_holder}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
in Template:Editions, only a single score holder can be specified, and * only works for scoreboard players reset (Template:Bug). in Template:Editions, multiple score holders can be specified.

Template:El<targets>: score_holder
Template:El: player: target: WildcardCommandSelector<Actor>

Specifies the score holders.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|score_holder}}{{#vardefine:be-arg|score_holder}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:El<objective>: objective
Template:El: objective: string: basic_string

Specifies the internal objective name.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|objective}}{{#vardefine:be-arg|string}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:El<score>: integer
Template:El: count: int: int

Specifies the new score, an amount to add to the score, or an amount to subtract from the score.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|integer}}{{#vardefine:be-arg|integer}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <min: int>: int

  1. REDIRECT Template:Edition

Template:Rcat: <max: int>: int

Specifies the min value and max value that the random number is between.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|integer}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <min: wildcard int>: CommandWildcardInt

  1. REDIRECT Template:Edition

Template:Rcat: <max: wildcard int>: int

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.

Template:El<targetObjective>: objective
Template:El: targetObjective: string: basic_string

Specifies the objective for targets.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|objective}}{{#vardefine:be-arg|string}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:El<source>: score_holder
Template:El: selector: target: WildcardCommandSelector<Actor>

Specifies the source score holders whose scores are used as source inputs.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|score_holder}}{{#vardefine:be-arg|score_holder}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:El<sourceObjective>: objective
Template:El: objective: string: basic_string

Specifies the objective for sources.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|objective}}{{#vardefine:be-arg|string}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Template:El<operation>: operation
Template:El: operation: operator: CommandOperator

Specifies the operation to be applied.
{{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|operation}}{{#vardefine:be-arg|operation}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  • = 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 is rounded down to an integer.
  • %= Modulus: Divide target's score by source's score, and use the positive remainder to set the target score
  1. REDIRECT Template:Code

Template:Redr Swapping: swaps target's score and source's score

  1. REDIRECT Template:Code

Template:Redr Choosing minimum: Set target's score to source's score only if source's score is less.

  1. REDIRECT Template:Code

Template:Redr Choosing maximum: Set target's score to source's score only if source's score is bigger.

In all cases except
  1. REDIRECT Template:Code

Template:Redr, source's score remains unchanged when performing the operation on a target. 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.

For /= and %=, if source's score is 0, the command fails in Template:Editions, or succeeds but does not change target's score in Template:Editions.
  1. REDIRECT Template:Edition

Template:Rcat: <text>: component

Specifies the display name.
{{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|component}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <contents>: component

Specifies display text.
{{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|component}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
  1. REDIRECT Template:Edition

Template:Rcat: <style>: style

Specifies the style.
Template:Arg desc

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of tracking objectives of the specified score holder}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... list <targets>}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the score's value}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... get ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of targets multiplied by the specified score}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... set ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the sum of the objective's score value of each target after execution}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... add ...
... remove ...
}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of the targets}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... reset ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of the targets whose scores are newly enabled}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... enable ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the sum of the objective's score value of each target after the operation on it}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... operation ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|Any}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the number of score holders}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... list}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the total number of tracking objectives of each score holder}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... list [playername: target]}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... set ...
... add ...
... remove ...
... random ...
}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the number of the targets that is tracked by the scoreboard (or the specified objective)}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... reset ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the number of the specified score holders whose score is between min and max}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... test ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|... operation ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

See also

  1. REDIRECT Template:Command

Template:Redr

  1. REDIRECT Template:Command

Template:Redr

  1. REDIRECT Template:Command

Template:Redr

External links

Navigation

All editions
Removed
Template:El only
Debug
Removed
Template:Els only
Template:El only
Removed
Template:El only
Removed
Template:Els only
Removed
Joke
Related

de:Befehl/scoreboard es:Comandos/scoreboard ja:コマンド/scoreboard pt:Comandos/scoreboard ru:Команды консоли/scoreboard uk:Команди консолі/scoreboard zh:命令/scoreboard