Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/scoreboard

Command

/scoreboard

Creates and manages scoreboard objectives, sets where they are shown, and reads or changes the scores of players and other entities.

Syntax

/scoreboard objectives add <objective> <criteria> [<displayName>]
/scoreboard objectives list
/scoreboard objectives modify <objective> (displayautoupdate <value>|displayname <displayName>)
/scoreboard objectives modify <objective> numberformat
/scoreboard objectives modify <objective> numberformat blank
/scoreboard objectives modify <objective> numberformat (fixed <contents>|styled <style>)
/scoreboard objectives modify <objective> rendertype (hearts|integer)
/scoreboard objectives remove <objective>
/scoreboard objectives setdisplay <slot> [<objective>]
/scoreboard players (add <targets>|remove <targets>) <objective> <score>
/scoreboard players display name <targets> <objective> [<name>]
/scoreboard players display numberformat <targets> <objective>
/scoreboard players display numberformat <targets> <objective> blank
/scoreboard players display numberformat <targets> <objective> (fixed <contents>|styled <style>)
/scoreboard players (enable <targets>|get <target>) <objective>
/scoreboard players list [<target>]
/scoreboard players operation <targets> <targetObjective> <operation> <source> <sourceObjective>
/scoreboard players reset <targets> [<objective>]
/scoreboard players set <targets> <objective> <score>

Arguments

ArgumentKind of valueWhat to type
<objective>TextThe objective's name. For objectives add it is the new name, one word without spaces. Everywhere else it must be an existing objective.
<criteria>Objective criterionWhat the objective counts: dummy, trigger, deathCount, playerKillCount, totalKillCount, health, food, air, armor, xp, level, teamkill.<color>, killedByTeam.<color>, or a statistic such as minecraft.custom:minecraft.jump.
<displayName>Text componentThe name shown for the objective, written as a text component such as "Kills" or {text:"Kills",color:"red"}.
<value>True or falsetrue or false for displayautoupdate.
<contents>Text componentThe text component shown instead of the number with numberformat fixed.
<style>Text styleThe text style used for the number with numberformat styled, for example {color:"gold"}.
<slot>Display slotThe display slot: list, sidebar, below_name or sidebar.team.<color>.
<targets>Score holderThe score holders to change: a target selector, a name, or * for all tracked score holders.
<score>Whole numberThe number to set (any whole number), or the amount to add or remove (0 or more). At least 0.
<name>Text componentThe text component shown in place of the score holder's name with players display name.
<target>Score holderA single score holder for players get and players list.
<targetObjective>Scoreboard objectiveThe objective whose score is changed by players operation. It must not be read-only.
<operation>Score operationOne of =, +=, -=, *=, /=, %=, <, >, ><.
<source>Score holderThe score holders whose scores are used as the second value in players operation.
<sourceObjective>Scoreboard objectiveThe objective the source scores are read from.

Details

Permission level2: operators, worlds with cheats on, command blocks and functions
Works inSingleplayer with cheats enabled, multiplayer servers, command blocks and functions. Needs permission level 2 (gamemasters): operators, players in a world with cheats enabled, command blocks and functions.
ResultEach sub-command reports what it changed. Numeric results: objectives add and objectives remove return the number of objectives that now exist; objectives list returns the number of objectives; objectives setdisplay and objectives modify return 0. players get returns the score; players set, add, remove and operation return the sum of the new scores of all targets; players reset and players display return the number of targets; players enable returns the number of targets whose trigger was newly enabled; players list returns the number of tracked score holders, or with a target the number of scores that target has.
objectives addCreates an objective with a name, a criterion and an optional display name. The name is a single word without spaces. Without a display name the name itself is shown. Fails with "An objective already exists by that name" if the name is taken.
CriteriaBasic criteria: dummy (changed only by commands), trigger (players change it themselves with /trigger), deathCount, playerKillCount, totalKillCount, health, food, air, armor, xp, level. Team criteria: teamkill.<color> and killedByTeam.<color> with a team color such as red or dark_blue. Statistic criteria use the form minecraft.<type>:minecraft.<id> with the types broken, crafted, custom, dropped, killed, killed_by, mined, picked_up and used, for example minecraft.mined:minecraft.stone or minecraft.custom:minecraft.jump.
Read-only criteriahealth, food, air, armor, xp and level are kept up to date by the game. Their scores cannot be changed with players set, add, remove or as the target of operation: "Scoreboard objective ... is read-only".
objectives list and removeobjectives list shows all objectives. objectives remove deletes an objective together with all of its scores.
objectives setdisplayShows an objective in a display slot. Slots: list (the player list), sidebar (the right side of the screen), below_name (under player name tags), and sidebar.team.<color> for a sidebar tied to a team color, with the colors black, dark_blue, dark_green, dark_aqua, dark_red, dark_purple, gold, gray, dark_gray, blue, green, aqua, red, light_purple, yellow and white. Leaving out the objective clears the slot. Fails if the slot is already empty or already shows that objective.
objectives modifydisplayname changes the shown name. rendertype switches between integer (numbers) and hearts (heart icons); health uses hearts by default, all others integer. numberformat sets the default look of all scores in the objective. displayautoupdate true or false turns the objective's display auto-update on or off.
Number formatsblank hides the number. fixed <contents> shows a fixed text instead of the number. styled <style> shows the number with a text style such as {color:"gold",bold:true}. Writing numberformat with nothing after it removes the format again. The same options exist for a whole objective (objectives modify ... numberformat) and for single score holders (players display numberformat).
players set, add, removeset gives a score any whole number from -2147483648 to 2147483647. add and remove take an amount of 0 or more and change the current score by it. A target that has no score yet starts at 0.
players get and listget shows one target's score and fails with "Can't get value of ... for ...; none is set" if there is none. list without a target shows every tracked name; with a target it shows all scores of that target.
players resetRemoves the targets' score in one objective, or all of their scores when no objective is given. A reset score is no longer set at all, which is different from 0.
players enableLets the targets use /trigger once on an objective with the trigger criterion. Fails with "Enable only works on trigger-objectives" for other objectives and with "Nothing changed. That trigger is already enabled" if no target was changed.
players operationChanges the target score using a source score. Signs: = sets the target to the source, += adds, -= subtracts, *= multiplies, /= divides (rounded down), %= leaves the remainder of the division (never negative for a positive divisor), < keeps the smaller of the two, > keeps the larger, >< swaps the two scores. Dividing by 0 fails with "Cannot divide by zero". With several sources the operation is applied once for each source.
players displaydisplay name gives a score holder a different name in the scoreboard display for one objective; leaving out the name removes it. display numberformat changes how that holder's number looks in that objective.
Score holdersTargets can be target selectors, player names or any made-up name such as #total. * stands for every tracked score holder. A selector that finds nothing fails with "No relevant score holders could be found".

Examples

/scoreboard objectives add kills playerKillCount "Kills"

Creates an objective named kills that counts player kills and is shown as Kills.

/scoreboard objectives add points dummy

Creates an objective named points that only changes through commands.

/scoreboard objectives setdisplay sidebar kills

Shows the kills objective on the right side of the screen.

/scoreboard players set @s points 10

Sets your points score to 10.

/scoreboard players add @a points 1

Adds 1 point to every online player.

/scoreboard players operation @s points += @s kills

Adds your kills score to your points score.

/scoreboard objectives modify points numberformat styled {color:"gold"}

Shows all numbers of the points objective in gold.

/scoreboard players reset @a points

Removes the points score of every online player.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)