Run Timing¶
For: intermediate authors wiring triggers, plus advanced authors tuning timing.
Triggers plus the options that shape them: start timing, chance, execution, intervals, and delays.
The commands (other than cleanup) run on these triggers:
| Value | Trigger |
|---|---|
ON_START |
Once when the match starts (runs for all participants) |
INTERVAL |
On a fixed interval that starts counting when the game begins |
ON_MOB_KILLED |
When a participating player kills a mob or other non-player entity (never players) |
ON_PLAYER_KILLS, ON_HUNTER_KILLS, ON_SPEEDRUNNER_KILLS |
When a participating player kills another player (variants fire for hunter/speedrunner killers only) |
ON_NETHER_ENTER |
When a participating player enters the Nether (once per player per match) |
ON_END_ENTER |
When a participating player enters the End (once per player per match) |
ON_FIRST_NETHER_ENTER |
When the first participating player enters the Nether (once per match) |
ON_FIRST_END_ENTER |
When the first participating player enters the End (once per match) |
ON_EVERY_ADVANCEMENT |
When a participating player earns any advancement (recipe book unlocks excluded) |
ON_RESPAWN, ON_SPEEDRUNNER_RESPAWN, ON_HUNTER_RESPAWN |
When a player is back in play after respawning (only the executing player; fires once per life, after headstart and respawn holds release; variants fire for their role only) |
ON_DAMAGE_TAKEN |
When a player takes damage from any source (runs for the damaged player only) |
ON_DEATH |
When a participant dies (runs for the dead player only; <args:0> is the exact dead-player name, <args:1> is the exact killer name or null) |
ON_DISCONNECT |
When a match member disconnects, eliminated by it or not (runs for the quitter only; <args:0> is the exact quitter name, <args:1> is the quitter role; there are no hunter/speedrunner variants) |
ON_ELIM, ON_SPEEDRUNNER_ELIM, ON_HUNTER_ELIM |
When a participant is eliminated, by death, removal, or disconnect (runs for the eliminated player only; <args:0> is the exact eliminated-player name, <args:1> is the former role; variants fire for their side only) |
Nothing runs automatically: if runs-on is omitted or empty, the
behavior stays silent and never fires on its own. Blocks that only
<runblock> calls omit it on purpose. To count every kill, enable both ON_MOB_KILLED and
ON_PLAYER_KILLS. Kill triggers see the attributed killer: the
vanilla killer when clear, else the last player the victim fought
within 8 seconds (lava and fire deaths after combat count as
kills); natural deaths fire no kill trigger and report null as
the ON_DEATH killer.
Except for ON_START, every event trigger runs the player, hunter, and
speedrunner commands only for the specific player involved in the event.
ON_START and INTERVAL run for all participating players instead.
Eliminations that land while the player is offline (an expired
disconnect grace) run the console commands only: there is no <p>
executor, so read the name from <args:0>.
Start Timing¶
An ON_START modifier can wait out the pre-start window before
running:
mods/modifiers/hunter-post-start-speed.yml:
behavior:
0:
on-start:
# BEFORE runs at /manhunt start; AFTER waits until the speedrunner
# first hits a hunter (or the match force-starts), plus any
# headstarts after that. Defaults to BEFORE.
pre-start-order: AFTER
This only applies when runs-on contains ON_START. When
start-on-speedrunner-damage is disabled there is no pre-start window,
so both settings run at match start.
With headstarts configured, AFTER waits until the last headstart ends;
with none configured it runs at begin as before.
INTERVAL behaviors can fire while an ON_START behavior with AFTER
is still waiting for headstarts. Guard intervals that depend on deferred
initialization with a match flag, and set it after initialization finishes:
behavior:
init:
runs-on: [ON_START]
on-start:
pre-start-order: AFTER
commands:
console:
- '<runblock:generate-card>'
- '<gflag:card-ready,true>'
poll:
runs-on: [INTERVAL]
commands:
console:
- '<if:"<gflag:card-ready> != true","exit">'
- '<runblock:check-card>'
Success Chance¶
Make the modifier run only sometimes:
mods/modifiers/gear-dice.yml:
behavior:
0:
options:
success-chance:
# Chance to run, from 0.0 (never) to 1.0 (always). This is a fraction,
# not a percent: use 0.5 for 50%. Defaults to 1.0.
chance: 0.5
# PER_INVOKE rolls once for everyone; PER_EXECUTOR rolls the console
# and each player separately. Defaults to PER_INVOKE.
behavior: PER_EXECUTOR
Without this section the modifier always runs. The roll happens on every trigger, including each interval firing. Cleanup commands always run and are never rolled.
Command Execution¶
Run a random line from a command list instead of every line:
mods/modifiers/gear-dice.yml:
behavior:
0:
options:
execution:
# IN_ORDER runs every line. PICK_RANDOM runs a random few instead.
# Defaults to IN_ORDER.
selection: PICK_RANDOM
pick-random:
# How many lines to pick. Minimum 1. Defaults to 1.
count: 1
# PER_INVOKE picks once for everyone; PER_EXECUTOR picks separately
# for the console and each player. Defaults to PER_INVOKE.
behavior: PER_EXECUTOR
This applies to each command list on its own. If you ask for more lines than the list has, the whole list runs. Cleanup lists always run every line so changes are reliably undone.
Interval Settings¶
How often an INTERVAL modifier repeats (only applies with
INTERVAL in runs-on):
mods/modifiers/random-mob-spawner.yml:
enabled: false
behavior:
0:
runs-on:
- INTERVAL
options:
interval-settings:
# Interval duration in seconds.
interval: 60
# Random spread in seconds. 60 and 15 means every 45 to 75 seconds.
# Cannot go above interval. Defaults to 0.
deviation: 15
# PER_INVOKE shares one timer; PER_EXECUTOR gives every player and the
# console their own timer. Defaults to PER_INVOKE.
behavior: PER_INVOKE
Interval modifiers start counting when the game actually begins (when a
speedrunner hits a hunter, or when the match force-starts), not when
/manhunt start is run.
With PER_EXECUTOR deviation, each player has their own timer, so players
who join mid-match get timed in as well.
The interval value supports decimals and is rounded to the nearest tick (1
tick = 0.05 seconds). Values between 0 and 0.05 execute every tick. Set to
0 or 0.05 for every-tick execution. Negative values disable the modifier.
Each firing skips players who cannot play right now: match watchers, dead players waiting on a respawn, and players held in spectator mode (respawn waits and headstart holds). The console list still fires.
Command Delay¶
Delay the modifier's commands by a number of ticks after they trigger:
mods/modifiers/everyone-gets-beef.yml:
The delay applies to start, interval, and event triggers, but never to cleanup commands. Player positions and roles resolve when the delayed commands fire, not when they trigger. If the match ends before the delay elapses, the commands are dropped.