Commands
Use the /scoreboard command
The /scoreboard command turns Minecraft into a tracker. You make an objective, pin it to the sidebar, and watch numbers climb as players earn them. Below is the exact syntax to build a live kill counter from nothing.
The full setup, one line at a time
- 1Create an objectiveRun /scoreboard objectives add kills playerKillCount. Name is kills, criterion is playerKillCount so it tracks itself.
- 2Show it on screenRun /scoreboard objectives setdisplay sidebar kills to pin the objective to the right-hand sidebar.
- 3Seed starting valuesRun /scoreboard players set Steve kills 0 so the player appears at zero instead of waiting for a first event.
- 4Change scores manuallyUse /scoreboard players add Alex kills 1 or players remove / players set for quests, deaths, or custom counters.
- 5Reset and clean upRun /scoreboard players reset Steve to wipe one entry, or objectives remove kills to delete the whole objective.
What you need
Quick answers
?
What does playerKillCount track?
It auto-increments every time that player kills another player. Use dummy instead if you want a counter only commands change.
?
How do I show the scoreboard on screen?
Run /scoreboard objectives setdisplay sidebar <objective>. You can also target list (tab menu) or belowName.
?
Why is a player missing from the sidebar?
The sidebar only lists entries with a score. Run /scoreboard players set <player> <objective> 0 to make them appear.
?
What is the difference between set, add, and remove?
set forces an exact value, add increases by an amount, remove decreases. All take a player, objective, and number.
?
Can a command block update the scoreboard?
Yes. Put /scoreboard players add @p kills 1 in a command block on a clock or a button to drive counters automatically.
?
How do I delete an objective completely?
Run /scoreboard objectives remove <objective>. This removes it from every display slot and deletes all stored scores.
?
Why does objectives add fail with an error?
Names must be unique and cannot contain spaces. Java allows letters, numbers, and the symbols - + . and _; Bedrock still caps the name at 16 characters while Java removed that limit in 1.18. A space or a duplicate name is the usual cause. Wrong criterion spelling fails too; criteria are case sensitive.
?
Can I rename the title shown above the sidebar?
The objective name is fixed once created, but the display name is separate. Add a JSON text component as the third argument, like /scoreboard objectives add kills playerKillCount {"text":"Kills","color":"gold"}, or set it later with objectives modify <name> displayname.
?
Do non-player entries like @e work on a scoreboard?
Yes. Any entity UUID or a fake player name (any string) can hold a score. Use a fake name like #total kills 0 to store global counters that never show as a real player.
?
Why is the sidebar empty after a server restart?
Objectives and scores persist in level data, but the setdisplay slot does not. Re-run /scoreboard objectives setdisplay sidebar <objective> on load, or put it in a function tagged minecraft:load.
?
How do I test a score in a command?
Use the target selector with scores, for example /execute if entity @p[scores={kills=10..}] run say done. The 10.. range means 10 or more; ..5 means 5 or less.