Свой сервер

Голодные игры в Майнкрафт

Датапак Голодных игр для Minecraft 1.21.11 — 26.3: арена с границей мира, корнукопия с пьедесталами и сундуки по карте. Граница сужается по таймеру, побеждает последний выживший — и через десять секунд новый раунд.

Арена

Граница сужается через

Граница мира квадратная. После таймера она идёт к центру до 20 блоков за 200 с — около полублока в секунду.

Игроки

Пьедесталов у корнукопии

Неуязвимость после старта

Кому пьедестала не хватило, смотрит раунд наблюдателем.

Сундуки

Лут

5 вещей в сундуке по карте, у корнукопии — на две больше и лучше.

Сундуков по карте

Арена сверху

Датапак · 1.21.11 — 26.3

Корнукопия: пьедесталы, сундуки и золото

Арена
200 × 200
Мест
12
Сундуков
8 + 24
Сужение
через 5 мин

Начать раунд — любой игрок

/trigger start

Перенести арену к себе (права оператора)

/function hungergames:here
Скачать датапак
Что внутри архива — 37 файлов

data/minecraft/tags/function/load.json

Тег load: игра зовёт эти функции при загрузке мира и после /reload.

{
  "values": [
    "hungergames:load"
  ]
}

data/minecraft/tags/function/tick.json

Тег tick: эти функции идут каждый тик — 20 раз в секунду.

{
  "values": [
    "hungergames:tick"
  ]
}

data/hungergames/function/loot/map.mcfunction

Макрос: один бросок по таблице — предмет в ячейку $(slot).

execute store result score #roll hungergames run random value 1..284
$execute if score #roll hungergames matches 1..16 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:wooden_sword 1
$execute if score #roll hungergames matches 17..32 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:stone_sword 1
$execute if score #roll hungergames matches 33..44 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:stone_axe 1
$execute if score #roll hungergames matches 45..54 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:bow 1
$execute if score #roll hungergames matches 55..70 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:arrow 8
$execute if score #roll hungergames matches 71..76 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:fishing_rod 1
$execute if score #roll hungergames matches 77..86 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:leather_helmet 1
$execute if score #roll hungergames matches 87..96 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:leather_chestplate 1
$execute if score #roll hungergames matches 97..106 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:leather_leggings 1
$execute if score #roll hungergames matches 107..116 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:leather_boots 1
$execute if score #roll hungergames matches 117..132 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:bread 3
$execute if score #roll hungergames matches 133..144 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:apple 2
$execute if score #roll hungergames matches 145..156 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:cooked_beef 4
$execute if score #roll hungergames matches 157..164 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:stick 2
$execute if score #roll hungergames matches 165..176 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_sword 1
$execute if score #roll hungergames matches 177..184 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_axe 1
$execute if score #roll hungergames matches 185..190 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:crossbow 1
$execute if score #roll hungergames matches 191..198 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:arrow 16
$execute if score #roll hungergames matches 199..206 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:chainmail_chestplate 1
$execute if score #roll hungergames matches 207..214 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:chainmail_leggings 1
$execute if score #roll hungergames matches 215..222 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_helmet 1
$execute if score #roll hungergames matches 223..230 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_boots 1
$execute if score #roll hungergames matches 231..238 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:shield 1
$execute if score #roll hungergames matches 239..244 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:golden_apple 1
$execute if score #roll hungergames matches 245..252 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_ingot 2
$execute if score #roll hungergames matches 253..256 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:flint_and_steel 1
$execute if score #roll hungergames matches 257..262 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:splash_potion[minecraft:potion_contents={potion:"minecraft:healing"}] 1
$execute if score #roll hungergames matches 263..266 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:potion[minecraft:potion_contents={potion:"minecraft:swiftness"}] 1
$execute if score #roll hungergames matches 267..268 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:diamond_sword 1
$execute if score #roll hungergames matches 269..270 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_sword[minecraft:enchantments={"minecraft:sharpness":1}] 1
$execute if score #roll hungergames matches 271..272 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:bow[minecraft:enchantments={"minecraft:power":1}] 1
$execute if score #roll hungergames matches 273..275 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_chestplate 1
$execute if score #roll hungergames matches 276..278 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_leggings 1
$execute if score #roll hungergames matches 279..279 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:diamond_chestplate 1
$execute if score #roll hungergames matches 280..280 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:diamond_helmet[minecraft:enchantments={"minecraft:protection":1}] 1
$execute if score #roll hungergames matches 281..282 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:ender_pearl 1
$execute if score #roll hungergames matches 283..284 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:diamond 1

data/hungergames/function/fill/map.mcfunction

Сундук под ногами: очистить и 5 бросков по таблице.

data modify block ~ ~ ~ Items set value []
function hungergames:loot/map {slot:13}
function hungergames:loot/map {slot:3}
function hungergames:loot/map {slot:23}
function hungergames:loot/map {slot:11}
function hungergames:loot/map {slot:15}

data/hungergames/function/loot/cornucopia.mcfunction

Макрос: один бросок по таблице — предмет в ячейку $(slot).

execute store result score #roll hungergames run random value 1..302
$execute if score #roll hungergames matches 1..16 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:wooden_sword 1
$execute if score #roll hungergames matches 17..32 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:stone_sword 1
$execute if score #roll hungergames matches 33..44 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:stone_axe 1
$execute if score #roll hungergames matches 45..54 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:bow 1
$execute if score #roll hungergames matches 55..70 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:arrow 8
$execute if score #roll hungergames matches 71..76 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:fishing_rod 1
$execute if score #roll hungergames matches 77..86 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:leather_helmet 1
$execute if score #roll hungergames matches 87..96 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:leather_chestplate 1
$execute if score #roll hungergames matches 97..106 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:leather_leggings 1
$execute if score #roll hungergames matches 107..116 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:leather_boots 1
$execute if score #roll hungergames matches 117..132 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:bread 3
$execute if score #roll hungergames matches 133..144 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:apple 2
$execute if score #roll hungergames matches 145..156 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:cooked_beef 4
$execute if score #roll hungergames matches 157..164 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:stick 2
$execute if score #roll hungergames matches 165..176 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_sword 1
$execute if score #roll hungergames matches 177..184 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_axe 1
$execute if score #roll hungergames matches 185..190 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:crossbow 1
$execute if score #roll hungergames matches 191..198 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:arrow 16
$execute if score #roll hungergames matches 199..206 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:chainmail_chestplate 1
$execute if score #roll hungergames matches 207..214 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:chainmail_leggings 1
$execute if score #roll hungergames matches 215..222 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_helmet 1
$execute if score #roll hungergames matches 223..230 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_boots 1
$execute if score #roll hungergames matches 231..238 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:shield 1
$execute if score #roll hungergames matches 239..244 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:golden_apple 1
$execute if score #roll hungergames matches 245..252 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_ingot 2
$execute if score #roll hungergames matches 253..256 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:flint_and_steel 1
$execute if score #roll hungergames matches 257..262 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:splash_potion[minecraft:potion_contents={potion:"minecraft:healing"}] 1
$execute if score #roll hungergames matches 263..266 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:potion[minecraft:potion_contents={potion:"minecraft:swiftness"}] 1
$execute if score #roll hungergames matches 267..270 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:diamond_sword 1
$execute if score #roll hungergames matches 271..274 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_sword[minecraft:enchantments={"minecraft:sharpness":1}] 1
$execute if score #roll hungergames matches 275..278 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:bow[minecraft:enchantments={"minecraft:power":1}] 1
$execute if score #roll hungergames matches 279..284 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_chestplate 1
$execute if score #roll hungergames matches 285..290 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:iron_leggings 1
$execute if score #roll hungergames matches 291..292 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:diamond_chestplate 1
$execute if score #roll hungergames matches 293..294 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:diamond_helmet[minecraft:enchantments={"minecraft:protection":1}] 1
$execute if score #roll hungergames matches 295..298 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:ender_pearl 1
$execute if score #roll hungergames matches 299..302 run return run item replace block ~ ~ ~ container.$(slot) with minecraft:diamond 1

data/hungergames/function/fill/cornucopia.mcfunction

Сундук под ногами: очистить и 7 бросков по таблице.

data modify block ~ ~ ~ Items set value []
function hungergames:loot/cornucopia {slot:13}
function hungergames:loot/cornucopia {slot:3}
function hungergames:loot/cornucopia {slot:23}
function hungergames:loot/cornucopia {slot:11}
function hungergames:loot/cornucopia {slot:15}
function hungergames:loot/cornucopia {slot:1}
function hungergames:loot/cornucopia {slot:25}

data/hungergames/function/build.mcfunction

Когда чанки площадки загружены — строить.

execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-10 ~ ~-10 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-10 ~ ~0 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-10 ~ ~10 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~0 ~ ~-10 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~0 ~ ~0 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~0 ~ ~10 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~10 ~ ~-10 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~10 ~ ~0 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~10 ~ ~10 run return run schedule function hungergames:build 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] run function hungergames:plaza

data/hungergames/function/plaza.mcfunction

Корнукопия: площадка, пьедесталы и сундуки у метки центра.

kill @e[type=marker,tag=hungergames_spot]
fill ~-3 ~ ~-10 ~3 ~12 ~-10 minecraft:air
fill ~-3 ~-1 ~-10 ~3 ~-1 ~-10 minecraft:grass_block
fill ~-3 ~-4 ~-10 ~3 ~-2 ~-10 minecraft:dirt
fill ~-5 ~ ~-9 ~5 ~12 ~-9 minecraft:air
fill ~-5 ~-1 ~-9 ~5 ~-1 ~-9 minecraft:grass_block
fill ~-5 ~-4 ~-9 ~5 ~-2 ~-9 minecraft:dirt
fill ~-6 ~ ~-8 ~6 ~12 ~-8 minecraft:air
fill ~-6 ~-1 ~-8 ~6 ~-1 ~-8 minecraft:grass_block
fill ~-6 ~-4 ~-8 ~6 ~-2 ~-8 minecraft:dirt
fill ~-7 ~ ~-7 ~7 ~12 ~-7 minecraft:air
fill ~-7 ~-1 ~-7 ~7 ~-1 ~-7 minecraft:grass_block
fill ~-7 ~-4 ~-7 ~7 ~-2 ~-7 minecraft:dirt
fill ~-8 ~ ~-6 ~8 ~12 ~-6 minecraft:air
fill ~-8 ~-1 ~-6 ~8 ~-1 ~-6 minecraft:grass_block
fill ~-8 ~-4 ~-6 ~8 ~-2 ~-6 minecraft:dirt
fill ~-9 ~ ~-5 ~9 ~12 ~-5 minecraft:air
fill ~-9 ~-1 ~-5 ~9 ~-1 ~-5 minecraft:grass_block
fill ~-9 ~-4 ~-5 ~9 ~-2 ~-5 minecraft:dirt
fill ~-9 ~ ~-4 ~9 ~12 ~-4 minecraft:air
fill ~-9 ~-1 ~-4 ~9 ~-1 ~-4 minecraft:grass_block
fill ~-9 ~-4 ~-4 ~9 ~-2 ~-4 minecraft:dirt
fill ~-10 ~ ~-3 ~10 ~12 ~-3 minecraft:air
fill ~-10 ~-1 ~-3 ~10 ~-1 ~-3 minecraft:grass_block
fill ~-10 ~-4 ~-3 ~10 ~-2 ~-3 minecraft:dirt
fill ~-10 ~ ~-2 ~10 ~12 ~-2 minecraft:air
fill ~-10 ~-1 ~-2 ~10 ~-1 ~-2 minecraft:grass_block
fill ~-10 ~-4 ~-2 ~10 ~-2 ~-2 minecraft:dirt
fill ~-10 ~ ~-1 ~10 ~12 ~-1 minecraft:air
fill ~-10 ~-1 ~-1 ~10 ~-1 ~-1 minecraft:grass_block
fill ~-10 ~-4 ~-1 ~10 ~-2 ~-1 minecraft:dirt
fill ~-10 ~ ~0 ~10 ~12 ~0 minecraft:air
fill ~-10 ~-1 ~0 ~10 ~-1 ~0 minecraft:grass_block
fill ~-10 ~-4 ~0 ~10 ~-2 ~0 minecraft:dirt
fill ~-10 ~ ~1 ~10 ~12 ~1 minecraft:air
fill ~-10 ~-1 ~1 ~10 ~-1 ~1 minecraft:grass_block
fill ~-10 ~-4 ~1 ~10 ~-2 ~1 minecraft:dirt
fill ~-10 ~ ~2 ~10 ~12 ~2 minecraft:air
fill ~-10 ~-1 ~2 ~10 ~-1 ~2 minecraft:grass_block
fill ~-10 ~-4 ~2 ~10 ~-2 ~2 minecraft:dirt
fill ~-10 ~ ~3 ~10 ~12 ~3 minecraft:air
fill ~-10 ~-1 ~3 ~10 ~-1 ~3 minecraft:grass_block
fill ~-10 ~-4 ~3 ~10 ~-2 ~3 minecraft:dirt
fill ~-9 ~ ~4 ~9 ~12 ~4 minecraft:air
fill ~-9 ~-1 ~4 ~9 ~-1 ~4 minecraft:grass_block
fill ~-9 ~-4 ~4 ~9 ~-2 ~4 minecraft:dirt
fill ~-9 ~ ~5 ~9 ~12 ~5 minecraft:air
fill ~-9 ~-1 ~5 ~9 ~-1 ~5 minecraft:grass_block
fill ~-9 ~-4 ~5 ~9 ~-2 ~5 minecraft:dirt
fill ~-8 ~ ~6 ~8 ~12 ~6 minecraft:air
fill ~-8 ~-1 ~6 ~8 ~-1 ~6 minecraft:grass_block
fill ~-8 ~-4 ~6 ~8 ~-2 ~6 minecraft:dirt
fill ~-7 ~ ~7 ~7 ~12 ~7 minecraft:air
fill ~-7 ~-1 ~7 ~7 ~-1 ~7 minecraft:grass_block
fill ~-7 ~-4 ~7 ~7 ~-2 ~7 minecraft:dirt
fill ~-6 ~ ~8 ~6 ~12 ~8 minecraft:air
fill ~-6 ~-1 ~8 ~6 ~-1 ~8 minecraft:grass_block
fill ~-6 ~-4 ~8 ~6 ~-2 ~8 minecraft:dirt
fill ~-5 ~ ~9 ~5 ~12 ~9 minecraft:air
fill ~-5 ~-1 ~9 ~5 ~-1 ~9 minecraft:grass_block
fill ~-5 ~-4 ~9 ~5 ~-2 ~9 minecraft:dirt
fill ~-3 ~ ~10 ~3 ~12 ~10 minecraft:air
fill ~-3 ~-1 ~10 ~3 ~-1 ~10 minecraft:grass_block
fill ~-3 ~-4 ~10 ~3 ~-2 ~10 minecraft:dirt
fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 minecraft:gold_block
setblock ~0 ~ ~-7 minecraft:chiseled_stone_bricks
summon marker ~0 ~1 ~-7 {Tags:["hungergames_spot"]}
setblock ~3 ~ ~-6 minecraft:chiseled_stone_bricks
summon marker ~3 ~1 ~-6 {Tags:["hungergames_spot"]}
setblock ~6 ~ ~-4 minecraft:chiseled_stone_bricks
summon marker ~6 ~1 ~-4 {Tags:["hungergames_spot"]}
setblock ~7 ~ ~0 minecraft:chiseled_stone_bricks
summon marker ~7 ~1 ~0 {Tags:["hungergames_spot"]}
setblock ~6 ~ ~3 minecraft:chiseled_stone_bricks
summon marker ~6 ~1 ~3 {Tags:["hungergames_spot"]}
setblock ~3 ~ ~6 minecraft:chiseled_stone_bricks
summon marker ~3 ~1 ~6 {Tags:["hungergames_spot"]}
setblock ~0 ~ ~7 minecraft:chiseled_stone_bricks
summon marker ~0 ~1 ~7 {Tags:["hungergames_spot"]}
setblock ~-3 ~ ~6 minecraft:chiseled_stone_bricks
summon marker ~-3 ~1 ~6 {Tags:["hungergames_spot"]}
setblock ~-6 ~ ~4 minecraft:chiseled_stone_bricks
summon marker ~-6 ~1 ~4 {Tags:["hungergames_spot"]}
setblock ~-7 ~ ~0 minecraft:chiseled_stone_bricks
summon marker ~-7 ~1 ~0 {Tags:["hungergames_spot"]}
setblock ~-6 ~ ~-4 minecraft:chiseled_stone_bricks
summon marker ~-6 ~1 ~-4 {Tags:["hungergames_spot"]}
setblock ~-4 ~ ~-6 minecraft:chiseled_stone_bricks
summon marker ~-4 ~1 ~-6 {Tags:["hungergames_spot"]}
setblock ~-1 ~ ~-1 minecraft:chest
setblock ~1 ~ ~-1 minecraft:chest
setblock ~-1 ~ ~1 minecraft:chest
setblock ~1 ~ ~1 minecraft:chest
setblock ~0 ~ ~-2 minecraft:chest
setblock ~2 ~ ~0 minecraft:chest
setblock ~0 ~ ~2 minecraft:chest
setblock ~-2 ~ ~0 minecraft:chest

data/hungergames/function/border.mcfunction

Граница арены 200 × 200 вокруг центра.

execute at @e[type=marker,tag=hungergames_center,limit=1] run worldborder center ~ ~
worldborder set 200
worldborder damage buffer 1
worldborder damage amount 1
worldborder warning distance 8

data/hungergames/function/shrink.mcfunction

Граница — до 20 блоков за 200 с.

worldborder set 20 200s
title @a title {"text":"Граница сужается!","color":"red"}
execute as @a at @s run playsound minecraft:block.bell.use master @s

data/hungergames/function/timer/start.mcfunction

Старт отсчёта: 300 с полосой босса.

bossbar remove hungergames:timer
bossbar add hungergames:timer {"text":"Граница сужается через"}
bossbar set hungergames:timer color red
bossbar set hungergames:timer max 300
scoreboard players set #timer hungergames 300
function hungergames:timer/second

data/hungergames/function/timer/second.mcfunction

Раз в секунду: полоса и надпись «мм:сс», по нулю — конец.

execute if score #timer hungergames matches ..0 run return run function hungergames:timer/end
bossbar set hungergames:timer players @a
execute store result bossbar hungergames:timer value run scoreboard players get #timer hungergames
scoreboard players operation #m hungergames = #timer hungergames
scoreboard players operation #s hungergames = #timer hungergames
scoreboard players set #60 hungergames 60
scoreboard players operation #m hungergames /= #60 hungergames
scoreboard players operation #s hungergames %= #60 hungergames
execute if score #s hungergames matches 10.. run bossbar set hungergames:timer name ["",{"text":"Граница сужается через "},{"score":{"name":"#m","objective":"hungergames"}},{"text":":"},{"score":{"name":"#s","objective":"hungergames"}}]
execute if score #s hungergames matches ..9 run bossbar set hungergames:timer name ["",{"text":"Граница сужается через "},{"score":{"name":"#m","objective":"hungergames"}},{"text":":0"},{"score":{"name":"#s","objective":"hungergames"}}]
scoreboard players remove #timer hungergames 1
schedule function hungergames:timer/second 1s

data/hungergames/function/timer/end.mcfunction

Время вышло: полосу убрать, дальше — своё.

bossbar remove hungergames:timer
function hungergames:shrink

data/hungergames/function/timer/stop.mcfunction

Остановить отсчёт.

schedule clear hungergames:timer/second
bossbar remove hungergames:timer

data/hungergames/function/place.mcfunction

Арена у метки центра: площадка и граница.

execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-10 ~-10 ~10 ~10
execute at @e[type=marker,tag=hungergames_center,limit=1] run setworldspawn ~ ~ ~
function hungergames:build
function hungergames:border

data/hungergames/function/box.mcfunction

Сундук по карте: стоит — на его место, нет — на поверхность.

execute if block ~ ~-1 ~ minecraft:chest positioned ~ ~-1 ~ run return run function hungergames:box/put
function hungergames:box/put

data/hungergames/function/box/put.mcfunction

Сундук и вещи в нём; на воде и лаве — с опорой.

execute if block ~ ~-1 ~ minecraft:water run setblock ~ ~-1 ~ minecraft:oak_planks
execute if block ~ ~-1 ~ minecraft:lava run setblock ~ ~-1 ~ minecraft:cobblestone
setblock ~ ~ ~ minecraft:air
setblock ~ ~ ~ minecraft:chest[facing=north]
execute positioned ~ ~ ~ run function hungergames:fill/map

data/hungergames/function/chests.mcfunction

Старт: 8 сундуков корнукопии заново, чанки сундуков по карте — в загрузку.

execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~-1 ~ ~-1 minecraft:air
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~-1 ~ ~-1 minecraft:chest[facing=north]
execute at @e[type=marker,tag=hungergames_center,limit=1] run execute positioned ~-1 ~ ~-1 run function hungergames:fill/cornucopia
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~1 ~ ~-1 minecraft:air
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~1 ~ ~-1 minecraft:chest[facing=north]
execute at @e[type=marker,tag=hungergames_center,limit=1] run execute positioned ~1 ~ ~-1 run function hungergames:fill/cornucopia
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~-1 ~ ~1 minecraft:air
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~-1 ~ ~1 minecraft:chest[facing=north]
execute at @e[type=marker,tag=hungergames_center,limit=1] run execute positioned ~-1 ~ ~1 run function hungergames:fill/cornucopia
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~1 ~ ~1 minecraft:air
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~1 ~ ~1 minecraft:chest[facing=north]
execute at @e[type=marker,tag=hungergames_center,limit=1] run execute positioned ~1 ~ ~1 run function hungergames:fill/cornucopia
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~0 ~ ~-2 minecraft:air
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~0 ~ ~-2 minecraft:chest[facing=north]
execute at @e[type=marker,tag=hungergames_center,limit=1] run execute positioned ~0 ~ ~-2 run function hungergames:fill/cornucopia
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~2 ~ ~0 minecraft:air
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~2 ~ ~0 minecraft:chest[facing=north]
execute at @e[type=marker,tag=hungergames_center,limit=1] run execute positioned ~2 ~ ~0 run function hungergames:fill/cornucopia
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~0 ~ ~2 minecraft:air
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~0 ~ ~2 minecraft:chest[facing=north]
execute at @e[type=marker,tag=hungergames_center,limit=1] run execute positioned ~0 ~ ~2 run function hungergames:fill/cornucopia
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~-2 ~ ~0 minecraft:air
execute at @e[type=marker,tag=hungergames_center,limit=1] run setblock ~-2 ~ ~0 minecraft:chest[facing=north]
execute at @e[type=marker,tag=hungergames_center,limit=1] run execute positioned ~-2 ~ ~0 run function hungergames:fill/cornucopia
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~66 ~3
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-6 ~-86
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-23 ~73
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~36 ~-81
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-46 ~-31
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-25 ~8
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~15 ~36
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~1 ~83
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~24 ~-16
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~52 ~72
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~51 ~-19
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-56 ~0
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~75 ~-28
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~28 ~-45
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-78 ~-24
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-50 ~-76
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-20 ~-28
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~53 ~31
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-47 ~27
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-78 ~43
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~70 ~53
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~0 ~-60
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~25 ~14
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-49 ~79
function hungergames:boxes

data/hungergames/function/boxes.mcfunction

Когда чанки загружены — 24 сундуков по карте, и чанки отпускаются.

execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~66 ~ ~3 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-6 ~ ~-86 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-23 ~ ~73 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~36 ~ ~-81 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-46 ~ ~-31 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-25 ~ ~8 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~15 ~ ~36 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~1 ~ ~83 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~24 ~ ~-16 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~52 ~ ~72 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~51 ~ ~-19 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-56 ~ ~0 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~75 ~ ~-28 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~28 ~ ~-45 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-78 ~ ~-24 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-50 ~ ~-76 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-20 ~ ~-28 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~53 ~ ~31 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-47 ~ ~27 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-78 ~ ~43 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~70 ~ ~53 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~0 ~ ~-60 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~25 ~ ~14 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] unless loaded ~-49 ~ ~79 run return run schedule function hungergames:boxes 5t
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~66 ~ ~3 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-6 ~ ~-86 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-23 ~ ~73 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~36 ~ ~-81 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-46 ~ ~-31 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-25 ~ ~8 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~15 ~ ~36 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~1 ~ ~83 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~24 ~ ~-16 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~52 ~ ~72 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~51 ~ ~-19 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-56 ~ ~0 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~75 ~ ~-28 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~28 ~ ~-45 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-78 ~ ~-24 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-50 ~ ~-76 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-20 ~ ~-28 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~53 ~ ~31 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-47 ~ ~27 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-78 ~ ~43 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~70 ~ ~53 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~0 ~ ~-60 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~25 ~ ~14 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] positioned ~-49 ~ ~79 positioned over motion_blocking_no_leaves run function hungergames:box
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~66 ~3
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-6 ~-86
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-23 ~73
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~36 ~-81
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-46 ~-31
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-25 ~8
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~15 ~36
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~1 ~83
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~24 ~-16
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~52 ~72
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~51 ~-19
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-56 ~0
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~75 ~-28
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~28 ~-45
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-78 ~-24
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-50 ~-76
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-20 ~-28
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~53 ~31
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-47 ~27
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-78 ~43
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~70 ~53
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~0 ~-60
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~25 ~14
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-49 ~79
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload add ~-10 ~-10 ~10 ~10

data/hungergames/function/grace.mcfunction

Неуязвимость вышла.

title @a actionbar {"text":"Неуязвимость кончилась","color":"red"}

data/hungergames/function/seat.mcfunction

На место под меткой — случайный игрок из очереди.

tag @r[tag=hungergames_queue] add hungergames_seat
tp @a[tag=hungergames_seat] ~ ~ ~ facing entity @e[type=marker,tag=hungergames_center,limit=1] feet
spawnpoint @a[tag=hungergames_seat] ~ ~ ~
tag @a[tag=hungergames_seat] add hungergames_alive
tag @a[tag=hungergames_seat] remove hungergames_queue
tag @a[tag=hungergames_seat] remove hungergames_seat

data/hungergames/function/load.mcfunction

При загрузке мира: счета, триггер старта и арена, если её ещё нет.

scoreboard objectives add hungergames dummy
scoreboard objectives add start trigger "Начать раунд"
scoreboard objectives add hungergames_deaths deathCount
scoreboard objectives add hungergames_left minecraft.custom:minecraft.leave_game
execute unless score #built hungergames matches 1 run schedule function hungergames:setup 1t
tellraw @a ["",{"text":"Голодные игры загружены. Начать раунд — "},{"text":"/trigger start","color":"gold","click_event":{"action":"run_command","command":"/trigger start"}},{"text":"."}]

data/hungergames/function/setup.mcfunction

Первая загрузка: метка центра на поверхности в 0 0 и арена вокруг.

forceload add 0 0
execute unless loaded 8 ~ 8 run return run schedule function hungergames:setup 5t
kill @e[type=marker,tag=hungergames_center]
summon marker 0.5 0 0.5 {Tags:["hungergames_center"]}
execute as @e[type=marker,tag=hungergames_center,limit=1] at @s positioned over motion_blocking_no_leaves run tp @s ~ ~ ~
function hungergames:place
scoreboard players set #built hungergames 1

data/hungergames/function/tick.mcfunction

Каждый тик: старт, новички и вернувшиеся, ход игры.

scoreboard players enable @a start
execute as @a[scores={start=1..}] run function hungergames:start
execute as @a[tag=!hungergames_seen] run function hungergames:join
execute as @a[scores={hungergames_left=1..}] run function hungergames:join
execute if score #state hungergames matches 1 run function hungergames:play

data/hungergames/function/join.mcfunction

Вошёл игрок: идёт раунд — смотрит, нет — в лобби. Вышедший из игры в неё не вернётся.

scoreboard players reset @s hungergames_left
tag @s add hungergames_seen
tag @s remove hungergames_alive
execute if score #state hungergames matches 1.. run return run function hungergames:watch
function hungergames:lobby

data/hungergames/function/watch.mcfunction

Опоздавший и выбывший смотрят наблюдателем.

gamemode spectator @s
tp @s @e[type=marker,tag=hungergames_center,limit=1]
tellraw @s {"text":"Идёт раунд — вы смотрите. Следующий начнётся сам.","color":"gray"}

data/hungergames/function/lobby.mcfunction

Игрок в лобби: режим приключения, пустой инвентарь, полное здоровье.

gamemode adventure @s
team leave @s
clear @s
effect clear @s
effect give @s minecraft:instant_health 1 20 true
effect give @s minecraft:saturation 1 20 true
xp set @s 0 levels
xp set @s 0 points
execute as @s run attribute @s minecraft:movement_speed base reset
execute as @s run attribute @s minecraft:jump_strength base reset
execute at @e[type=marker,tag=hungergames_center,limit=1] run tp @s ~ ~ ~
execute at @e[type=marker,tag=hungergames_center,limit=1] run spawnpoint @s ~ ~ ~

data/hungergames/function/start.mcfunction

/trigger start — места, отсчёт. Прав оператора не нужно.

scoreboard players set @s start 0
execute if score #state hungergames matches 1.. run return run tellraw @s {"text":"Раунд уже идёт."}
execute store result score #players hungergames if entity @a
execute if score #players hungergames matches ..1 run return run tellraw @s {"text":"Нужно хотя бы 2 игрока.","color":"red"}
scoreboard players set #state hungergames 2
tag @a add hungergames_queue
execute as @e[type=marker,tag=hungergames_spot] at @s run function hungergames:seat
execute as @a[tag=hungergames_alive] run attribute @s minecraft:movement_speed base set 0
execute as @a[tag=hungergames_alive] run attribute @s minecraft:jump_strength base set 0
execute as @a[tag=hungergames_queue] run function hungergames:watch
tag @a remove hungergames_queue
execute as @a[tag=hungergames_alive] run function hungergames:prep
scoreboard players set #count hungergames 10
function hungergames:count

data/hungergames/function/prep.mcfunction

Игрок на месте: пустой инвентарь, полное здоровье и сытость.

gamemode adventure @s
clear @s
effect clear @s
effect give @s minecraft:instant_health 1 20 true
effect give @s minecraft:saturation 1 20 true
xp set @s 0 levels
xp set @s 0 points
scoreboard players reset @s hungergames_deaths

data/hungergames/function/count.mcfunction

Отсчёт 10 … 1 титрами, по нулю — старт.

execute if score #count hungergames matches ..0 run return run function hungergames:go
title @a times 0 25 5
title @a title {"score":{"name":"#count","objective":"hungergames"},"color":"gold"}
execute as @a at @s run playsound minecraft:block.note_block.hat master @s
scoreboard players remove #count hungergames 1
schedule function hungergames:count 1s

data/hungergames/function/go.mcfunction

Старт раунда.

scoreboard players set #state hungergames 1
gamemode survival @a[tag=hungergames_alive]
title @a title {"text":"Старт!","color":"green"}
execute as @a at @s run playsound minecraft:entity.player.levelup master @s
execute as @a[tag=hungergames_alive] run attribute @s minecraft:movement_speed base reset
execute as @a[tag=hungergames_alive] run attribute @s minecraft:jump_strength base reset
function hungergames:chests
function hungergames:timer/start
effect give @a[tag=hungergames_alive] minecraft:resistance 30 4 true
title @a subtitle {"text":"Неуязвимость — 30 с"}
schedule function hungergames:grace 30s

data/hungergames/function/play.mcfunction

Каждый тик раунда: смерти, падения и кто остался.

execute as @a[tag=hungergames_alive,scores={hungergames_deaths=1..}] run function hungergames:died
execute store result score #alive hungergames if entity @a[tag=hungergames_alive]
execute if score #alive hungergames matches ..1 run function hungergames:win

data/hungergames/function/died.mcfunction

Игрок погиб.

scoreboard players reset @s hungergames_deaths
function hungergames:out

data/hungergames/function/out.mcfunction

Выбыл: наблюдатель до конца раунда.

gamemode spectator @s
tag @s remove hungergames_alive
execute store result score #alive hungergames if entity @a[tag=hungergames_alive]
tellraw @a ["",{"selector":"@s"},{"text":" выбывает. В игре: ","color":"gray"},{"score":{"name":"#alive","objective":"hungergames"}}]

data/hungergames/function/win.mcfunction

Победа: титры, через 10 с — новый раунд.

scoreboard players set #state hungergames 3
function hungergames:timer/stop
schedule clear hungergames:grace
execute if score #alive hungergames matches 1 run title @a title {"selector":"@a[tag=hungergames_alive]","color":"gold"}
execute if score #alive hungergames matches 1 run title @a subtitle {"text":"победитель!"}
execute if score #alive hungergames matches 0 run title @a title {"text":"Ничья"}
tellraw @a {"text":"Новый раунд — через 10 с.","color":"gray"}
schedule function hungergames:restart 10s

data/hungergames/function/restart.mcfunction

Новый раунд: арена заново, все — в лобби.

scoreboard players set #state hungergames 0
kill @e[type=item]
kill @e[type=experience_orb]
kill @e[type=arrow]
function hungergames:build
function hungergames:border
tag @a remove hungergames_alive
execute as @a run function hungergames:lobby
tellraw @a ["",{"text":"Арена готова. Начать — "},{"text":"/trigger start","color":"gold","click_event":{"action":"run_command","command":"/trigger start"}},{"text":"."}]

data/hungergames/function/here.mcfunction

/function hungergames:here — перенести арену к себе (оператор). Старая площадка останется.

execute if score #state hungergames matches 1.. run return run tellraw @s {"text":"Раунд идёт — дождитесь конца."}
execute unless loaded ~ ~ ~ run return run tellraw @s {"text":"Здесь мир не загружен — встаньте на место."}
execute at @e[type=marker,tag=hungergames_center,limit=1] run forceload remove ~-10 ~-10 ~10 ~10
kill @e[type=marker,tag=hungergames_center]
execute align xyz positioned ~0.5 ~ ~0.5 run summon marker ~ ~ ~ {Tags:["hungergames_center"]}
function hungergames:place
tellraw @s {"text":"Арена здесь: площадка, сундуки и граница — вокруг вас.","color":"green"}

Что лежит в сундуках

Вещи кладутся броском по таблице: у каждого сундука и каждого раунда свой набор. Шанс — за один бросок.

Сундуки по карте 5 предметов

  • Деревянный меч 5,6 %
  • Каменный меч 5,6 %
  • Стрела ×8 5,6 %
  • Хлеб ×3 5,6 %
  • Каменный топор 4,2 %
  • Яблоко ×2 4,2 %
  • Стейк ×4 4,2 %
  • Железный меч 4,2 %
  • Лук 3,5 %
  • Кожаный шлем 3,5 %
  • Кожаная куртка 3,5 %
  • Кожаные штаны 3,5 %
  • Кожаные ботинки 3,5 %
  • Палка ×2 2,8 %
  • Железный топор 2,8 %
  • Стрела ×16 2,8 %
  • Кольчуга 2,8 %
  • Кольчужные поножи 2,8 %
  • Железный шлем 2,8 %
  • Железные ботинки 2,8 %
  • Щит 2,8 %
  • Железный слиток ×2 2,8 %
  • Удочка 2,1 %
  • Арбалет 2,1 %
  • Золотое яблоко 2,1 %
  • Взрывное зелье · лечение 2,1 %
  • Огниво 1,4 %
  • Зелье · скорость 1,4 %
  • Железный нагрудник 1,1 %
  • Железные поножи 1,1 %
  • Алмазный меч 0,7 %
  • Железный меч · Острота I 0,7 %
  • Лук · Сила I 0,7 %
  • Эндер-жемчуг 0,7 %
  • Алмаз 0,7 %
  • Алмазный нагрудник 0,4 %
  • Алмазный шлем · Защита I 0,4 %

Корнукопия 7 предметов

  • Деревянный меч 5,3 %
  • Каменный меч 5,3 %
  • Стрела ×8 5,3 %
  • Хлеб ×3 5,3 %
  • Каменный топор 4 %
  • Яблоко ×2 4 %
  • Стейк ×4 4 %
  • Железный меч 4 %
  • Лук 3,3 %
  • Кожаный шлем 3,3 %
  • Кожаная куртка 3,3 %
  • Кожаные штаны 3,3 %
  • Кожаные ботинки 3,3 %
  • Палка ×2 2,6 %
  • Железный топор 2,6 %
  • Стрела ×16 2,6 %
  • Кольчуга 2,6 %
  • Кольчужные поножи 2,6 %
  • Железный шлем 2,6 %
  • Железные ботинки 2,6 %
  • Щит 2,6 %
  • Железный слиток ×2 2,6 %
  • Удочка 2 %
  • Арбалет 2 %
  • Золотое яблоко 2 %
  • Взрывное зелье · лечение 2 %
  • Железный нагрудник 2 %
  • Железные поножи 2 %
  • Огниво 1,3 %
  • Зелье · скорость 1,3 %
  • Алмазный меч 1,3 %
  • Железный меч · Острота I 1,3 %
  • Лук · Сила I 1,3 %
  • Эндер-жемчуг 1,3 %
  • Алмаз 1,3 %
  • Алмазный нагрудник 0,7 %
  • Алмазный шлем · Защита I 0,7 %

Как начать

  1. Положите датапак в мир

    В одиночной игре — saves/<мир>/datapacks, на сервере — world/datapacks, потом /reload. Распаковывать не нужно.

  2. Арена встанет сама

    Вокруг 0 0 мира: площадка расчищается, встают пьедесталы, сундуки и граница. В море или в горах — перенесите её к себе: /function hungergames:here.

  3. Начинайте

    Нужно хотя бы двое. Кто-то пишет /trigger start — все встают на пьедесталы, десять секунд отсчёта, и сундуки наполняются.

Что нужно знать

  • До старта не сойти. На отсчёте у игроков скорость и прыжок — ноль. Сундуки пустые до старта: в лобби их не обчистить.
  • Неуязвимость 30 с. Сразу после старта — Сопротивление V: ни меч, ни падение не ранят, можно разбежаться за вещами.
  • Выбыл — смотрит. Погибший становится наблюдателем до конца раунда, опоздавший — тоже. Последний живой — победитель, его ник — титром у всех.
  • Сундуки по карте — на одних местах. Места постоянные для настроек, и каждый раунд эти же сундуки наполняются заново. На воде под сундуком встанут доски.
  • Новый раунд — сам. Через десять секунд после победы площадка строится заново, граница возвращается, все — у корнукопии. Ямы и постройки на остальной карте остаются.
  • Права не нужны. Старт — /trigger start, его пишет любой игрок; оператор нужен только, чтобы положить датапак и перенести арену.

Разбросать игроков по карте вместо пьедесталов — генератор /tp, острова в пустоте — SkyWars, кровати и ресурсы — BedWars. Готовые Голодные игры с десятками игроков — на серверах HungerGames в мониторинге.

Частые вопросы

Как сделать голодные игры в Майнкрафте без плагинов?

Скачайте датапак и положите его в папку datapacks мира или сервера. Арена встанет вокруг 0 0: площадка с пьедесталами, сундуки и граница. Раунд начинает любой игрок командой /trigger start.

Как перенести арену голодных игр в другое место?

Встаньте, где нужна арена, и выполните /function hungergames:here — нужны права оператора. Площадка, сундуки и граница мира встанут вокруг вас, старая площадка останется.

Когда сужается граница в голодных играх?

Через выбранное время после старта — его видно полосой босса. Потом граница идёт к центру до 20 блоков, около полублока в секунду, а за ней идёт урон.