اسکوربوردها: معیارهایی که موارد را خودکار ردیابی میکنند و جایگاههای نمایش
بیشتر آموزشهای اسکوربورد فقط از dummy استفاده میکنند. معیارهای داخلی مرگها، بلاکهای استخراجشده و آمار سفارشی را بدون هیچ دستوری ردیابی میکنند — در اینجا شکل کامل آن آمده است.
dummy is the criterion everyone learns, and it is the one that does nothing on its own. The interesting ones update themselves.
ایجاد یک هدف
/scoreboard objectives add Deaths deathCount "Times died"
deathCount is the criterion. The quoted part is the display name and is optional.
معیارهایی که خودشان را ردیابی میکنند
| معیار | افزایش مییابد وقتی |
|---|---|
deathCount | بازیکن میمیرد |
playerKillCount | یک بازیکن را میکشند |
totalKillCount | هر چیزی را میکشند |
health | به طور مداوم — 0 تا 20 |
food, air, armor, xp, level | به طور مداوم |
dummy | هرگز — فقط /scoreboard players set |
trigger | هرگز، اما بازیکنان میتوانند آن را تغییر دهند از طریق /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.
معیارهای آماری منبع عمیقی هستند
/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
هر آماری که بازی از قبل ردیابی میکند میتواند بدون هیچ تابع تکرارشوندهای یک هدف را هدایت کند. دستهها عبارتند از minecraft.mined, minecraft.crafted, minecraft.used, minecraft.broken, minecraft.picked_up, minecraft.dropped, minecraft.killed, minecraft.killed_by and minecraft.custom.
توجه داشته باشید موارد مسافت بر حسب سانتیمتر — walk_one_cm divided by 100 is blocks.
جایگاههای نمایش
/scoreboard objectives setdisplay sidebar Deaths
/scoreboard objectives setdisplay list Deaths
/scoreboard objectives setdisplay below_name Deaths
sidebar— پنل سمت راست، 15 ورودی برترlist— کنار نامها در لیست تبbelow_name— شناور زیر برچسب نام بازیکن
نوار کناری پسوند رنگ تیم را نیز میپذیرد — sidebar.team.red — showing that objective only to players on that team. That is how one server shows different scores to different teams.
خواندن یک مقدار در یک دستور
/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.
پاکسازی
اهداف برای همیشه در فایل جهان باقی میمانند. /scoreboard objectives remove <name> when a map is finished, otherwise a heavily-iterated datapack leaves dozens of dead objectives that still tick.
هر gamerule همراه با مقدار پیشفرض آن، بهعلاوه آمار اسکوربورد و فرکانسهای رویداد بازی، فهرست شدهاند در مرجع و ماشینحسابها — مجموعه 4.