Mga Scoreboard: ang mga criteria na awtomatikong sumusubaybay sa mga bagay, at mga display slot
Karamihan sa mga tutorial ng scoreboard ay dummy lang ang ginagamit. Ang mga built-in na criteria ay sumusubaybay sa mga pagkamatay, mga naminang bloke at mga custom na stat nang walang anumang command — narito ang buong detalye.
dummy is the criterion everyone learns, and it is the one that does nothing on its own. The interesting ones update themselves.
Paggawa ng objective
/scoreboard objectives add Deaths deathCount "Times died"
deathCount is the criterion. The quoted part is the display name and is optional.
Mga criteria na kusang sumusubaybay
| Criterion | Dumaragdag kapag |
|---|---|
deathCount | namatay ang manlalaro |
playerKillCount | nakapatay sila ng manlalaro |
totalKillCount | nakapatay sila ng kahit ano |
health | patuloy — 0 hanggang 20 |
food, air, armor, xp, level | patuloy |
dummy | hinding-hindi — tanging /scoreboard players set |
trigger | hinding-hindi, ngunit maaaring baguhin ito ng mga manlalaro sa pamamagitan ng /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.
Ang mga statistic criteria ang malalim na balon
/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
Anumang estadistika na sinusubaybayan na ng laro ay maaaring magpagana ng objective, nang walang ticking function. Ang mga pamilya ay minecraft.mined, minecraft.crafted, minecraft.used, minecraft.broken, minecraft.picked_up, minecraft.dropped, minecraft.killed, minecraft.killed_by and minecraft.custom.
Tandaan na ang mga para sa distansya ay nasa sentimetro — walk_one_cm divided by 100 is blocks.
Mga display slot
/scoreboard objectives setdisplay sidebar Deaths
/scoreboard objectives setdisplay list Deaths
/scoreboard objectives setdisplay below_name Deaths
sidebar— ang kanang panel, nangungunang 15 entrilist— katabi ng mga pangalan sa tab listbelow_name— lumulutang sa ilalim ng nametag ng manlalaro
Tumatanggap din ang sidebar ng suffix ng kulay ng team — sidebar.team.red — showing that objective only to players on that team. That is how one server shows different scores to different teams.
Pagbasa ng halaga sa isang command
/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.
Paglilinis
Mananatili magpakailanman ang mga objective sa file ng mundo. /scoreboard objectives remove <name> when a map is finished, otherwise a heavily-iterated datapack leaves dozens of dead objectives that still tick.
Nakalista ang bawat gamerule kasama ang default nito, pati ang mga estadistika ng scoreboard at dalas ng game-event sa Sanggunian at mga Calculator — Set 4.