Minecraft:Commands/scoreboard: Difference between revisions
More actions
imported>MinecraftBedrockPlayer7 mNo edit summary |
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= | |others=Cheat only{{only|bedrock|short=1}} | ||
}} | }} | ||
Manages and displays scores for various | 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 | :: Lists all existing objectives with their display names and criteria. | ||
: <code>scoreboard objectives '''add''' <objective> <criteria> [<displayName>]</code> ({{ | : <code>scoreboard objectives '''add''' <objective> <criteria> [<displayName>]</code> ({{MC/El|java}}) | ||
: <code>scoreboard objectives '''add''' <objective: string> dummy [displayName: string]</code> ({{ | : <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> ({{ | : <code>scoreboard objectives '''remove''' <objective></code> ({{MC/El|java}}) | ||
: <code>scoreboard objectives '''remove''' <objective: string></code> ({{ | : <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> ({{ | : <code>scoreboard objectives '''setdisplay''' <slot> [<objective>]</code> ({{MC/El|java}}) | ||
: <code>scoreboard objectives '''setdisplay''' <list|sidebar> [objective: string] [ascending|descending]</code> ({{ | : <code>scoreboard objectives '''setdisplay''' <list|sidebar> [objective: string] [ascending|descending]</code> ({{MC/El|bedrock}}) | ||
: <code>scoreboard objectives '''setdisplay''' belowname [objective: string]</code> ({{ | : <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). {{ | :: 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> ({{ | : <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> ({{ | : <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> ({{ | : <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> ({{ | : <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> ({{ | : <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> ({{ | : <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> ({{ | : <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 === | ||
{{ | {{MC/Argument|objective|objective|objective: string|basic_string}} | ||
: Specifies the internal objective name. | : Specifies the internal objective name. | ||
: {{ | : {{MC/Arg desc|je=objective|be=basic_string}} | ||
{{ | {{MC/Argument|criteria|objective_criteria|dummy}} | ||
: Specifies the criterion of the new objective. | : Specifies the criterion of the new objective. | ||
: {{ | : {{MC/Arg desc|je=objective_criteria}} {{MC/In|bedrock}}, "dummy" is the only criterion currently supported | ||
{{ | {{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. | ||
: {{ | : {{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=, }}, {{MC/Cd|A|Z|delimiter=-}}, {{MC/Cd|a|z|delimiter=-}}, and {{MC/Cd|0|9|delimiter=-}}) or a double-quoted string. | ||
{{ | {{MC/Argument|slot|scoreboard_slot|<nowiki>list|sidebar|belowname</nowiki>}} | ||
: Specifies the slot to display the objective. | : Specifies the slot to display the objective. | ||
: {{ | : {{MC/Arg desc|je=scoreboard_slot}} Valid slots are listed and described in Display Slots. | ||
: {{ | : {{MC/Arg desc|je=objective|be=basic_string}} | ||
{{ | {{MC/El|be|short=1}}: <code>ascending|descending</code> | ||
: Specifies the sort order. | : Specifies the sort order. | ||
{{ | {{MC/El|je|short=1}}: {{MC/Argument|value|bool}} | ||
: Specifies whether display names are auto-updated. | : Specifies whether display names are auto-updated. | ||
: {{ | : {{MC/Arg desc|je=bool}} | ||
{{ | {{MC/El|je|short=1}}: {{MC/Argument|displayName|component}} | ||
: Specifies the display name. | : Specifies the display name. | ||
: {{ | : {{MC/Arg desc|je=component}} | ||
{{ | {{MC/El|je|short=1}}: {{MC/Argument|component|component}} | ||
: Specifies display text. | : Specifies display text. | ||
: {{ | : {{MC/Arg desc|je=component}} | ||
{{ | {{MC/El|je|short=1}}: {{MC/Argument|style|style}} | ||
: Specifies the style. | : Specifies the style. | ||
: {{arg_desc|je=style}} | : {{arg_desc|je=style}} | ||
{{ | {{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> ({{ | : <code>scoreboard players '''list''' [<target>]</code> ({{MC/El|java}}) | ||
: <code>scoreboard players '''list''' [playername: target]</code> ({{ | : <code>scoreboard players '''list''' [playername: target]</code> ({{MC/El|bedrock}}) | ||
:: Lists all | :: 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> ({{ | : <code>scoreboard players '''get''' <target> <objective></code> ({{MC/El|java}}) | ||
:: Return the scoreboard value. Can be used in conjunction with the {{ | :: 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> <score></code> ({{ | : <code>scoreboard players '''set''' <targets> <objective> <score></code> ({{MC/El|java}}) | ||
:<code>scoreboard players '''set''' <player: target> <objective: string> <count: int></code> ({{ | :<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> <score></code> ({{ | : <code>scoreboard players '''add''' <targets> <objective> <score></code> ({{MC/El|java}}) | ||
: <code>scoreboard players '''add''' <player: target> <objective: string> <count: int></code> ({{ | : <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. {{ | :: 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> <score></code> ({{ | : <code>scoreboard players '''remove''' <targets> <objective> <score></code> ({{MC/El|java}}) | ||
: <code>scoreboard players '''remove''' <player: target> <objective: string> <count: int></code> ({{ | : <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. {{ | :: 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> ({{ | : <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> ({{ | : <code>scoreboard players '''reset''' <targets> [<objective>]</code> ({{MC/El|java}}) | ||
: <code>scoreboard players '''reset''' <player: target> [objective: string]</code> ({{ | : <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. | ||
:: {{ | :: {{MC/In|java}}, this also disables the target players' ability to use {{MC/Cmd|trigger}} command (on the given objective if specified). | ||
:: {{ | :: {{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> ({{ | : <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> ({{ | : <code>scoreboard players '''enable''' <targets> <objective></code> ({{MC/El|java}}) | ||
:: Enables the target(s) to use the {{ | :: 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> <source> <sourceObjective></code> ({{ | : <code>scoreboard players '''operation''' <targets> <targetObjective> <operation> <source> <sourceObjective></code> ({{MC/El|java}}) | ||
: <code>scoreboard players '''operation''' <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string></code> ({{ | : <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> ({{ | : <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> ({{ | : <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> ({{ | : <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> ({{ | : <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> ({{ | : <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> ({{ | : <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 === | ||
{{ | {{MC/Argument|target|score_holder|playername: target|WildcardCommandSelector<Actor>}} | ||
: Specifies the score holder. | : Specifies the score holder. | ||
: {{ | : {{MC/Arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}} | ||
: {{ | : {{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. | ||
{{ | {{MC/Argument|targets|score_holder|player: target|WildcardCommandSelector<Actor>}} | ||
: Specifies the score holders. | : Specifies the score holders. | ||
: {{ | : {{MC/Arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}} | ||
{{ | {{MC/Argument|objective|objective|objective: string|basic_string}} | ||
: Specifies the internal objective name. | : Specifies the internal objective name. | ||
: {{ | : {{MC/Arg desc|je=objective|be=basic_string}} | ||
{{ | {{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. | ||
: {{ | : {{MC/Arg desc|je=integer|be=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. | ||
: {{ | : {{MC/Arg desc|be=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. | ||
{{ | {{MC/Argument|targetObjective|objective|targetObjective: string|basic_string}} | ||
: Specifies the objective for targets. | : Specifies the objective for targets. | ||
: {{ | : {{MC/Arg desc|je=objective|be=basic_string}} | ||
{{ | {{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. | ||
: {{ | : {{MC/Arg desc|je=score_holder|be=WildcardCommandSelector<Actor>}} | ||
{{ | {{MC/Argument|sourceObjective|objective|objective: string|basic_string}} | ||
: Specifies the objective for sources. | : Specifies the objective for sources. | ||
: {{ | : {{MC/Arg desc|je=objective|be=basic_string}} | ||
{{ | {{MC/Argument|operation|operation|operation: operator|CommandOperator}} | ||
: Specifies the operation to be applied. | : Specifies the operation to be applied. | ||
: {{ | : {{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 | ||
:* {{ | :* {{MC/Cd|><}} Swapping: swaps target's score and source's score | ||
:* {{ | :* {{MC/Cd|<}} Choosing minimum: Set target's score to source's score only if source's score is less. | ||
:* {{ | :* {{MC/Cd|>}} Choosing maximum: Set target's score to source's score only if source's score is bigger. | ||
: In all cases except {{ | : 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 {{ | : 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}}. | ||
{{ | {{MC/El|je|short=1}}: {{MC/Argument|text|component}} | ||
: Specifies the display name. | : Specifies the display name. | ||
: {{ | : {{MC/Arg desc|je=component}} | ||
{{ | {{MC/El|je|short=1}}: {{MC/Argument|contents|component}} | ||
: Specifies display text. | : Specifies display text. | ||
: {{ | : {{MC/Arg desc|je=component}} | ||
{{ | {{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 {{ | |{{HistoryLine||1.5|dev=13w04a|Added {{MC/Cmd|scoreboard|link=none}}.}} | ||
|{{HistoryLine||1.13|dev=17w45a|Split teams usage to {{ | |{{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 {{ | |{{HistoryLine|||dev=pre7|Added {{MC/Cmd|scoreboard objectives modify <''objectiveName''> displayname <''displayName''>|link=none}}.}} | ||
|{{HistoryLine|||dev=pre8|Added {{ | |{{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 {{ | |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 {{ | |{{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 {{ | |{{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 {{ | |{{HistoryLine||1.7.0|dev=beta 1.7.0.2|Added {{MC/Cmd|scoreboard|link=none}}.}} | ||
}} | }} | ||
== See also == | == See also == | ||
*{{ | *{{MC/Cmd|team}} | ||
*{{ | *{{MC/Cmd|tag}} | ||
*{{ | *{{MC/Cmd|random}} | ||
== External links == | == External links == | ||
| Line 284: | Line 284: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/scoreboard | |||
es:Comandos/scoreboard | |||
ja:コマンド/scoreboard | |||
pt:Comandos/scoreboard | |||
ru:Команды консоли/scoreboard | |||
uk:Команди консолі/scoreboard | |||
zh:命令/scoreboard | |||
Latest revision as of 20:13, 9 April 2026
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>](
- REDIRECT Template:Edition
scoreboard objectives add <objective: string> dummy [displayName: string](
- REDIRECT Template:Edition
- Creates a new objective with the given internal objective name, specified criterion, and the optional display name.
scoreboard objectives remove <objective>(
- REDIRECT Template:Edition
scoreboard objectives remove <objective: string>(
- REDIRECT Template:Edition
- 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>](
- REDIRECT Template:Edition
scoreboard objectives setdisplay <list|sidebar> [objective: string] [ascending|descending](
- REDIRECT Template:Edition
scoreboard objectives setdisplay belowname [objective: string](
- REDIRECT Template:Edition
- 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
listorsidebar, there is an additional optional argumentascending|descendingto 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). in Template:Editions, if slot is
scoreboard objectives modify <objective> displayautoupdate <value>(
- REDIRECT Template:Edition
- Changes whether or not display names are automatically updated on every score update.
scoreboard objectives modify <objective> displayname <displayName>(
- REDIRECT Template:Edition
- Changes the display name of the scoreboard in display slots.
scoreboard objectives modify <objective> numberformat(
- REDIRECT Template:Edition
- Resets the default number format of the scoreboard in display slots and in score text components.
scoreboard objectives modify <objective> numberformat blank(
- REDIRECT Template:Edition
- Sets the default number format to blank, which indicates that the score is not shown.
scoreboard objectives modify <objective> numberformat fixed <component>(
- REDIRECT Template:Edition
- 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>(
- REDIRECT Template:Edition
- 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)(
- REDIRECT Template:Edition
- 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:
- REDIRECT Template:Code
- REDIRECT Template:Code
- REDIRECT Template:Code
Template:Redr, and
- 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|}}
- REDIRECT Template:Edition
Template:Rcat: ascending|descending
- Specifies the sort order.
- 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|}}
- 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|}}
- 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|}}
- REDIRECT Template:Edition
Template:Rcat: <style>: style
- Specifies the style.
- Template:Arg desc
- 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 ...}}{{#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}}
... remove ...
{{#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>](
- REDIRECT Template:Edition
scoreboard players list [playername: target](
- REDIRECT Template:Edition
- Lists all score holders that are tracked in some way by the scoreboard system. The optional
<target>orplayername: targetparameter 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
scoreboard players get <target> <objective>(
- REDIRECT Template:Edition
- Return the scoreboard value. Can be used in conjunction with the
- REDIRECT Template:Command
Template:Redr command:
- REDIRECT Template:Command
scoreboard players set <targets> <objective> <score>(
- REDIRECT Template:Edition
scoreboard players set <player: target> <objective: string> <count: int>(
- REDIRECT Template:Edition
- Set the targets' scores in the given objective, overwriting any previous score.
scoreboard players add <targets> <objective> <score>(
- REDIRECT Template:Edition
scoreboard players add <player: target> <objective: string> <count: int>(
- REDIRECT Template:Edition
- 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>(
- REDIRECT Template:Edition
scoreboard players remove <player: target> <objective: string> <count: int>(
- REDIRECT Template:Edition
- 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>(
- REDIRECT Template:Edition
- Sets the targets' scores in that objective to a random number between min and max (both inclusive).
scoreboard players reset <targets> [<objective>](
- REDIRECT Template:Edition
scoreboard players reset <player: target> [objective: string](
- REDIRECT Template:Edition
- 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
- Deletes score or all scores for the targets. If
- 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, whilescoreboard players reset @awill only reset the scores of players online.
- in Template:Editions, running
scoreboard players test <player: target> <objective: string> <min: wildcard int> [<max: wildcard int>](
- REDIRECT Template:Edition
- Tests if targets' scores are between min and max (defaults to MAX_INT(2,147,483,647)).
scoreboard players enable <targets> <objective>(
- REDIRECT Template:Edition
- Enables the target(s) to use the
- 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
- REDIRECT Template:Command
Template:Redr command. Until this command has been run, players can't trigger that objective. Using the
- 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>(
- REDIRECT Template:Edition
scoreboard players operation <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string>(
- REDIRECT Template:Edition
- 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>(
- REDIRECT Template:Edition
- Resets the display name of the targets' scores.
scoreboard players display name <targets> <objective> <text>(
- REDIRECT Template:Edition
- Changes the display name of the targets' scores.
scoreboard players display numberformat <targets> <objective>(
- REDIRECT Template:Edition
- Resets the number format of the targets' scores.
scoreboard players display numberformat <targets> <objective> blank(
- REDIRECT Template:Edition
- 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>(
- REDIRECT Template:Edition
- 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>(
- REDIRECT Template:Edition
- 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 forscoreboard 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|}}
- REDIRECT Template:Edition
Template:Rcat: <min: int>: int
- 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|}}
- REDIRECT Template:Edition
Template:Rcat: <min: wildcard int>: CommandWildcardInt
- 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 intcan be replaced with asterisk (*) to represent -2,147,483,648, andmax: wildcardint 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
- REDIRECT Template:Code
Template:Redr Swapping: swaps target's score and source's score
- REDIRECT Template:Code
Template:Redr Choosing minimum: Set target's score to source's score only if source's score is less.
- 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
- 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.
- 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|}}
- 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|}}
- 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 ...}}{{#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}}|
... remove ...... 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 ...}}{{#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}}|
... add ...
... remove ...
... random ...... 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
Bedrock Edition
See also
- REDIRECT Template:Command
- REDIRECT Template:Command
- REDIRECT Template:Command
External links
de:Befehl/scoreboard es:Comandos/scoreboard ja:コマンド/scoreboard pt:Comandos/scoreboard ru:Команды консоли/scoreboard uk:Команди консолі/scoreboard zh:命令/scoreboard