Scoreborden: de criteria die automatisch dingen bijhouden en weergaveslots
De meeste scorebordhandleidingen gebruiken alleen dummy. De ingebouwde criteria houden sterfgevallen, gemijnde blokken en aangepaste statistieken bij zonder enige opdrachten — dit is het volledige overzicht.
dummy is the criterion everyone learns, and it is the one that does nothing on its own. The interesting ones update themselves.
Een doel maken
/scoreboard objectives add Deaths deathCount "Times died"
deathCount is the criterion. The quoted part is the display name and is optional.
Criteria die zichzelf bijhouden
| Criterium | Verhoogt wanneer |
|---|---|
deathCount | de speler sterft |
playerKillCount | ze een speler doden |
totalKillCount | ze iets doden |
health | continu — 0 tot 20 |
food, air, armor, xp, level | continu |
dummy | nooit — alleen /scoreboard players set |
trigger | nooit, maar spelers kunnen het wijzigen via /trigger |
trigger is the useful one for menus: a normal player cannot run /scoreboard players set, but they can run /trigger, which lets you build clickable menus that work without op.
Statistiekcriteria zijn de diepe bron
/scoreboard objectives add Mined minecraft.mined:minecraft.diamond_ore
/scoreboard objectives add Walked minecraft.custom:minecraft.walk_one_cm
/scoreboard objectives add Jumps minecraft.custom:minecraft.jump
Elke statistiek die het spel al bijhoudt kan een doel aansturen, zonder tikkende functie. De categorieën zijn minecraft.mined, minecraft.crafted, minecraft.used, minecraft.broken, minecraft.picked_up, minecraft.dropped, minecraft.killed, minecraft.killed_by and minecraft.custom.
Let op: afstandsstatistieken zijn in centimeter — walk_one_cm divided by 100 is blocks.
Weergaveslots
/scoreboard objectives setdisplay sidebar Deaths
/scoreboard objectives setdisplay list Deaths
/scoreboard objectives setdisplay below_name Deaths
sidebar— het rechterpaneel, bovenste 15 vermeldingenlist— naast namen in de tablijstbelow_name— zwevend onder het naamplaatje van de speler
De sidebar accepteert ook een teamkleursuffix — sidebar.team.red — showing that objective only to players on that team. That is how one server shows different scores to different teams.
Een waarde uitlezen in een opdracht
/execute store result score @s Temp run data get entity @s Pos[1]
/execute if score @s Deaths matches 5.. run say five or more
matches takes a range: 5, 5.., ..5, 1..10. This is the standard way to branch on a score, and it is why store result matters — it is the bridge between world data and scoreboard arithmetic.
Opschonen
Doelen blijven voor altijd in het wereldbestand bewaard. /scoreboard objectives remove <name> when a map is finished, otherwise a heavily-iterated datapack leaves dozens of dead objectives that still tick.
Elke gamerule met zijn standaardwaarde, plus scorebordstatistieken en frequenties van spelgebeurtenissen, staan vermeld in Referentie & Rekenmachines — Set 4.