Свой сервер

Манхант: бегун против охотников

Датапак для Minecraft 1.21.9 — 26.3: бегун проходит игру, охотники гонятся за ним с компасом, который показывает, где бегун сейчас. Роли и старт — командой /trigger, без прав оператора.

Фора бегуну

Столько секунд после старта охотники стоят на месте и не прыгают.

Компас

Как часто компас охотника ищет бегуна. Реже — сложнее охота.

Правила

Свечение видно сквозь стены — для новичков. Без огня по своим охотники не мешают друг другу.

Как играть

Датапак · 1.21.9 — 26.3

1. Бегун пишет в чат

/trigger runner

2. Охотники пишут

/trigger hunter

3. Любой начинает охоту

/trigger start
Фора
30 с
Компас
раз в секунду
Скачать датапак
Что внутри архива — 15 файлов

data/minecraft/tags/function/load.json

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

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

data/minecraft/tags/function/tick.json

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

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

data/manhunt/function/load.mcfunction

При загрузке мира: счета, триггеры, команды с цветом ника и подсказка в чат.

scoreboard objectives add manhunt dummy
scoreboard objectives add runner trigger "Стать бегуном"
scoreboard objectives add hunter trigger "Стать охотником"
scoreboard objectives add start trigger "Начать охоту"
scoreboard objectives add manhunt_deaths deathCount
scoreboard objectives add manhunt_dragon minecraft.killed:minecraft.ender_dragon
team add manhunt_runners
team modify manhunt_runners color green
team add manhunt_hunters
team modify manhunt_hunters color red
team modify manhunt_hunters friendlyFire false
tellraw @a ["",{"text":"Манхант загружен. Бегун — "},{"text":"/trigger runner","color":"green","click_event":{"action":"run_command","command":"/trigger runner"}},{"text":", охотник — "},{"text":"/trigger hunter","color":"red","click_event":{"action":"run_command","command":"/trigger hunter"}},{"text":", начать — "},{"text":"/trigger start","color":"gold","click_event":{"action":"run_command","command":"/trigger start"}},{"text":"."}]
schedule function manhunt:track 20t

data/manhunt/function/tick.mcfunction

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

scoreboard players enable @a runner
scoreboard players enable @a hunter
scoreboard players enable @a start
execute as @a[scores={runner=1..}] run function manhunt:role/runner
execute as @a[scores={hunter=1..}] run function manhunt:role/hunter
execute as @a[scores={start=1..}] run function manhunt:start
execute as @a[tag=manhunt_hunter] unless items entity @s container.* minecraft:compass[minecraft:custom_data~{manhunt:1b}] unless items entity @s weapon.offhand minecraft:compass[minecraft:custom_data~{manhunt:1b}] run give @s minecraft:compass[minecraft:custom_data={manhunt:1b},minecraft:item_name={"text":"Компас охотника","color":"red"}]
execute if score #running manhunt matches 1 as @a[tag=manhunt_runner,scores={manhunt_deaths=1..}] run function manhunt:runner_out
execute if score #running manhunt matches 1 unless entity @a[tag=manhunt_runner] run function manhunt:hunters_win
execute if score #running manhunt matches 1 if entity @a[tag=manhunt_runner,scores={manhunt_dragon=1..}] run function manhunt:runner_wins

data/manhunt/function/role/runner.mcfunction

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

tag @s remove manhunt_hunter
tag @s add manhunt_runner
team join manhunt_runners @s
clear @s minecraft:compass[minecraft:custom_data~{manhunt:1b}]
tellraw @a ["",{"selector":"@s"},{"text":" — бегун."}]
scoreboard players set @s runner 0

data/manhunt/function/role/hunter.mcfunction

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

tag @s remove manhunt_runner
tag @s add manhunt_hunter
team join manhunt_hunters @s
tellraw @a ["",{"selector":"@s"},{"text":" — охотник."}]
scoreboard players set @s hunter 0

data/manhunt/function/start.mcfunction

Старт охоты: счёт смертей с нуля, охотники стоят 30 с.

scoreboard players set @s start 0
execute unless entity @a[tag=manhunt_runner] run return run tellraw @s ["",{"text":"Сначала кто-то должен стать бегуном: "},{"text":"/trigger runner","color":"green","click_event":{"action":"run_command","command":"/trigger runner"}}]
scoreboard players set #running manhunt 1
scoreboard players reset * manhunt_deaths
scoreboard players reset * manhunt_dragon
title @a title {"text":"Охота началась!"}
title @a subtitle {"text":"Охотники выйдут через 30 с"}
execute as @a[tag=manhunt_hunter] run attribute @s minecraft:movement_speed base set 0
execute as @a[tag=manhunt_hunter] run attribute @s minecraft:jump_strength base set 0
schedule function manhunt:release 30s

data/manhunt/function/release.mcfunction

Фора вышла: охотникам возвращаются скорость и прыжок.

execute as @a[tag=manhunt_hunter] run attribute @s minecraft:movement_speed base reset
execute as @a[tag=manhunt_hunter] run attribute @s minecraft:jump_strength base reset
title @a[tag=manhunt_hunter] title {"text":"Вперёд!"}

data/manhunt/function/track.mcfunction

Поиск бегуна — раз в секунду.

execute as @a[tag=manhunt_hunter] at @s run function manhunt:point
schedule function manhunt:track 20t

data/manhunt/function/point.mcfunction

Для охотника: где ближайший бегун в его измерении.

execute as @p[tag=manhunt_runner,distance=0..] run function manhunt:store
execute if entity @p[tag=manhunt_runner,distance=0..] run function manhunt:aim with storage manhunt:pos

data/manhunt/function/store.mcfunction

Координаты бегуна и его измерение — в хранилище для макроса.

execute store result storage manhunt:pos x int 1 run data get entity @s Pos[0]
execute store result storage manhunt:pos y int 1 run data get entity @s Pos[1]
execute store result storage manhunt:pos z int 1 run data get entity @s Pos[2]
data modify storage manhunt:pos dim set from entity @s Dimension

data/manhunt/function/aim.mcfunction

Макрос: компас в руке смотрит на бегуна.

$execute if items entity @s weapon.mainhand minecraft:compass[minecraft:custom_data~{manhunt:1b}] run item replace entity @s weapon.mainhand with minecraft:compass[minecraft:custom_data={manhunt:1b},minecraft:item_name={"text":"Компас охотника","color":"red"},minecraft:lodestone_tracker={target:{pos:[I;$(x),$(y),$(z)],dimension:"$(dim)"},tracked:false}]
$execute if items entity @s weapon.offhand minecraft:compass[minecraft:custom_data~{manhunt:1b}] run item replace entity @s weapon.offhand with minecraft:compass[minecraft:custom_data={manhunt:1b},minecraft:item_name={"text":"Компас охотника","color":"red"},minecraft:lodestone_tracker={target:{pos:[I;$(x),$(y),$(z)],dimension:"$(dim)"},tracked:false}]

data/manhunt/function/runner_out.mcfunction

Бегун погиб: теперь он наблюдает.

gamemode spectator @s
tag @s remove manhunt_runner
team leave @s
tellraw @a ["",{"selector":"@s"},{"text":" выбыл."}]

data/manhunt/function/hunters_win.mcfunction

Бегунов не осталось — победа охотников.

scoreboard players set #running manhunt 0
title @a title {"text":"Охотники победили!"}

data/manhunt/function/runner_wins.mcfunction

Дракон Эндера убит — победа бегуна.

scoreboard players set #running manhunt 0
effect clear @a[tag=manhunt_runner] minecraft:glowing
title @a title {"text":"Бегун победил!"}

Как поставить

  1. Скачайте датапак

    Распаковывать не нужно: игра читает его прямо из zip.

  2. Положите в мир

    В одиночной игре — saves/<мир>/datapacks, на сервере — world/datapacks. Мир — любой, новый лучше.

  3. Перезагрузите

    Командой /reload или перезапуском — в чате появится подсказка с кнопками ролей.

  4. Играйте с друзьями

    Откройте мир для сети или зайдите на свой сервер. Охотникам компас выдаётся сам — и снова после смерти.

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

  • Компас смотрит на бегуна в своём измерении. Ушёл бегун в Незер — компас охотника в обычном мире показывает, где видел его последним: там и портал.
  • Компас работает в руке. В основной или во второй руке — точка обновляется раз в секунду. Лежащий в инвентаре компас показывает старую точку, пока его не возьмут.
  • Победа — сама. Бегун погиб — он становится наблюдателем, и если бегунов не осталось, побеждают охотники. Бегун убил дракона Эндера — победил он.
  • Ники цветные. Бегуны — зелёные, охотники — красные: пак заводит две команды игры.
  • Права не нужны. Роли и старт — через /trigger, его может писать любой игрок, даже без читов.

Играть с другом по сети — как это сделать в вики. Свои правила для мира — конструктор /gamerule.

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

Как играть в манхант в Майнкрафте?

Положите датапак в мир. Бегун пишет /trigger runner, охотники — /trigger hunter, охоту начинает /trigger start. Охотники получают компас, который показывает на бегуна.

Почему компас охотника не показывает на бегуна?

Компас ищет бегуна в своём измерении и обновляется в руке. Если бегун в Незере, а охотник в обычном мире, компас покажет, где бегун был последний раз.

Нужны ли читы для манханта?

Нет: роли и старт — через /trigger, его пишет любой игрок. Права нужны только чтобы положить датапак и сделать /reload.