Minecraft:Commands/scoreboard: Difference between revisions
More actions
imported>MinecraftBedrockPlayer7 mNo edit summary |
Remove broken links to missing pages |
||
| 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> ({{el|java}}) | : <code>scoreboard objectives '''add''' <objective> <criteria> [<displayName>]</code> ({{el|java}}) | ||
: <code>scoreboard objectives '''add''' <objective: string> dummy [displayName: string]</code> ({{el|bedrock}}) | : <code>scoreboard objectives '''add''' <objective: string> dummy [displayName: string]</code> ({{el|bedrock}}) | ||
| Line 49: | Line 49: | ||
{{argument|displayName|component|displayName: string|basic_string}} | {{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 | : {{IN|java}}, must be a raw JSON text. {{IN|bedrock}}, it must be either a single word that isn't a number (allowed characters: {{cd|-|:|.|_|delimiter=, }}, {{cd|A|Z|delimiter=-}}, {{cd|a|z|delimiter=-}}, and {{cd|0|9|delimiter=-}}) or a double-quoted string. | ||
{{argument|slot|scoreboard_slot|<nowiki>list|sidebar|belowname</nowiki>}} | {{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 | : {{arg desc|je=scoreboard_slot}} Valid slots are listed and described in Display Slots. | ||
: {{arg desc|je=objective|be=basic_string}} | : {{arg desc|je=objective|be=basic_string}} | ||
| Line 101: | Line 101: | ||
: <code>scoreboard players '''list''' [<target>]</code> ({{el|java}}) | : <code>scoreboard players '''list''' [<target>]</code> ({{el|java}}) | ||
: <code>scoreboard players '''list''' [playername: target]</code> ({{el|bedrock}}) | : <code>scoreboard players '''list''' [playername: target]</code> ({{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> ({{el|java}}) | : <code>scoreboard players '''get''' <target> <objective></code> ({{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 {{cmd|execute}} command: {{cmd|execute store result ... run scoreboard players get ...}} | ||
| Line 286: | Line 286: | ||
{{Navbox commands}} | {{Navbox commands}} | ||
de:Befehl/scoreboard | |||
es:Comandos/scoreboard | |||
ja:コマンド/scoreboard | |||
pt:Comandos/scoreboard | |||
ru:Команды консоли/scoreboard | |||
uk:Команди консолі/scoreboard | |||
zh:命令/scoreboard | |||
Revision as of 15:45, 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>](Template:El)scoreboard objectives add <objective: string> dummy [displayName: string](Template:El)- Creates a new objective with the given internal objective name, specified criterion, and the optional display name.
scoreboard objectives remove <objective>(Template:El)scoreboard objectives remove <objective: string>(Template:El)- 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>](Template:El)scoreboard objectives setdisplay <list|sidebar> [objective: string] [ascending|descending](Template:El)scoreboard objectives setdisplay belowname [objective: string](Template:El)- 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). Template:IN, 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). Template:IN, if slot is
scoreboard objectives modify <objective> displayautoupdate <value>(Template:El)- Changes whether or not display names are automatically updated on every score update.
scoreboard objectives modify <objective> displayname <displayName>(Template:El)- Changes the display name of the scoreboard in display slots.
scoreboard objectives modify <objective> numberformat(Template:El)- Resets the default number format of the scoreboard in display slots and in score text components.
scoreboard objectives modify <objective> numberformat blank(Template:El)- Sets the default number format to blank, which indicates that the score is not shown.
scoreboard objectives modify <objective> numberformat fixed <component>(Template:El)- 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>(Template:El)- 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)(Template:El)- Changes the display format for scores in the tab player list.
Arguments
- Specifies the internal objective name.
- Template:Arg desc
- Specifies the criterion of the new objective.
- Template:Arg desc Template:IN, "dummy" is the only criterion currently supported
- Specifies the display name, defaulting to
<objective>when unspecified. - Template:IN, must be a raw JSON text. Template:IN, it must be either a single word that isn't a number (allowed characters: Template:Cd, Template:Cd, Template:Cd, and Template:Cd) or a double-quoted string.
- Specifies the slot to display the objective.
- Template:Arg desc Valid slots are listed and described in Display Slots.
- Template:Arg desc
Template:El: ascending|descending
- Specifies the sort order.
Template:El: Template:Argument
- Specifies whether display names are auto-updated.
- Template:Arg desc
Template:El: Template:Argument
- Specifies the display name.
- Template:Arg desc
Template:El: Template:Argument
- Specifies display text.
- Template:Arg desc
Template:El: Template:Argument
- Specifies the style.
- Template:Arg desc
Template:El: 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
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
Players commands
Syntax
scoreboard players list [<target>](Template:El)scoreboard players list [playername: target](Template:El)- 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>(Template:El)- Return the scoreboard value. Can be used in conjunction with the Template:Cmd command: Template:Cmd
scoreboard players set <targets> <objective> <score>(Template:El)scoreboard players set <player: target> <objective: string> <count: int>(Template:El)- Set the targets' scores in the given objective, overwriting any previous score.
scoreboard players add <targets> <objective> <score>(Template:El)scoreboard players add <player: target> <objective: string> <count: int>(Template:El)- Increments the targets' scores in that objective by the given amount. Template:IN, a negative count subtracts from the score.
scoreboard players remove <targets> <objective> <score>(Template:El)scoreboard players remove <player: target> <objective: string> <count: int>(Template:El)- Decrements the targets' scores in that objective by the given amount. Template:IN, a negative number adds to the score.
scoreboard players random <player: target> <objective: string> <min: int> <max: int>(Template:El)- Sets the targets' scores in that objective to a random number between min and max (both inclusive).
scoreboard players reset <targets> [<objective>](Template:El)scoreboard players reset <player: target> [objective: string](Template:El)- 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.
- Template:IN, this also disables the target players' ability to use Template:Cmd command (on the given objective if specified).
- Template:IN, running
scoreboard players reset *will reset the scores of all players, whilescoreboard players reset @awill only reset the scores of players online.
- Deletes score or all scores for the targets. If
scoreboard players test <player: target> <objective: string> <min: wildcard int> [<max: wildcard int>](Template:El)- Tests if targets' scores are between min and max (defaults to MAX_INT(2,147,483,647)).
scoreboard players enable <targets> <objective>(Template:El)- Enables the target(s) to use the Template:Cmd command on the specified objective. This command accepts non-player entities, but only players are able to actually use the Template:Cmd command. Until this command has been run, players can't trigger that objective. Using the Template:Cmd 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>(Template:El)scoreboard players operation <player: target> <targetObjective: string> <operation: operator> <selector: target> <objective: string>(Template:El)- 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>(Template:El)- Resets the display name of the targets' scores.
scoreboard players display name <targets> <objective> <text>(Template:El)- Changes the display name of the targets' scores.
scoreboard players display numberformat <targets> <objective>(Template:El)- Resets the number format of the targets' scores.
scoreboard players display numberformat <targets> <objective> blank(Template:El)- 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>(Template:El)- 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>(Template:El)- Sets the number format of the targets' scores to styled, which indicates that the score is displayed with the selected style.
Arguments
- Specifies the score holder.
- Template:Arg desc
- Template:IN, only a single score holder can be specified, and
*only works forscoreboard players reset(Template:Bug). Template:IN, multiple score holders can be specified.
- Specifies the score holders.
- Template:Arg desc
- Specifies the internal objective name.
- Template:Arg desc
- Specifies the new score, an amount to add to the score, or an amount to subtract from the score.
- Template:Arg desc
Template:El: Template:Argument
Template:El: Template:Argument
- Specifies the min value and max value that the random number is between.
- Template:Arg desc
Template:El: Template:Argument
Template:El: Template:Argument
- 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.
- Specifies the objective for targets.
- Template:Arg desc
- Specifies the source score holders whose scores are used as source inputs.
- Template:Arg desc
- Specifies the objective for sources.
- Template:Arg desc
- Specifies the operation to be applied.
- Template:Arg desc
=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- Template:Cd Swapping: swaps target's score and source's score
- Template:Cd Choosing minimum: Set target's score to source's score only if source's score is less.
- Template:Cd Choosing maximum: Set target's score to source's score only if source's score is bigger.
- In all cases except Template: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
/=and%=, if source's score is 0, the command fails Template:In, or succeeds but does not change target's score Template:In.
Template:El: Template:Argument
- Specifies the display name.
- Template:Arg desc
Template:El: Template:Argument
- Specifies display text.
- Template:Arg desc
Template:El: Template:Argument
- 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
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
History
Java Edition
Bedrock Edition
See also
External links
de:Befehl/scoreboard es:Comandos/scoreboard ja:コマンド/scoreboard pt:Comandos/scoreboard ru:Команды консоли/scoreboard uk:Команди консолі/scoreboard zh:命令/scoreboard