Updated:
Common scoreboard tasks
- Create an objective.
- Show it in the sidebar.
- Add or remove points.
- Reset a player score.
- Use scores in execute conditions.
Run the scoreboard commands in order
Create an objective once, then change player scores and choose where to display them. Keep the objective name identical in each command, otherwise the later commands will not use the score you created.
Examples in minigames
Typical examples include a coin counter, death counter, countdown timer, ranking display and game state flag.
Example: a basic Java scoreboard
/scoreboard objectives add points dummy
/scoreboard objectives setdisplay sidebar points
/scoreboard players add @p points 1Run these in order in a Java Edition test world. The first command creates a manually controlled objective named points. The second displays the objective in the sidebar, and the third adds one point to the nearest player. An objective cannot be displayed before it has been created.
Common setup errors
If the first command reports that the objective already exists, do not recreate it; continue with the display or add command. If a later command fails, check the exact objective spelling. In a multiplayer game, selectors determine whose scores change: @p affects one nearby player, whereas @a can update every player.
Making scoreboard changes safely
Take a backup before modifying a live minigame scoreboard. Test score additions and display commands in a separate world, then add any repeat or conditional command blocks. Command syntax and available display slots can differ by edition, so use the edition selector in the generator before copying a multi-command workflow.
A simple shop: spend 100 coins on bread
/execute as @p if entity @s[scores={coins=100..}] run give @s minecraft:bread 5
/execute as @p if entity @s[scores={coins=100..}] run scoreboard players remove @s coins 100
scores={coins=100..} means "players with 100 or more coins". The nearest player is picked first with as @p, so another player never pays instead, and players who cannot afford it are skipped and nobody goes below zero. In command blocks, put the first line in an impulse block and the second in a chain block behind it so both run from one button press.
Let players without operator rights use it: trigger
/scoreboard objectives add shop trigger
/scoreboard players enable @a shop
Normal players cannot run /scoreboard, but they can change a trigger objective with /trigger shop. A repeating command block can detect the change, run the purchase, reset the value to 0 and enable it again. Bedrock Edition has no trigger objectives, so use buttons there.
Display slots
| Slot | Where it appears |
|---|---|
sidebar | A list on the right of the screen |
list | The player list opened with Tab |
below_name | Under each player's name tag (belowName in older versions) |
To hide a display, run /scoreboard objectives setdisplay sidebar without an objective name.
FAQ
How do I reset everyone's score?
/scoreboard players set @a coins 0 sets everyone to 0. /scoreboard players reset @a coins removes the score entirely.
Does the same setup work in Bedrock?
Creating objectives, adding, removing and displaying scores use the same syntax. The main differences are the missing trigger type and selector arguments such as r= instead of distance=.