Skip to main content
A trigger decides when a line runs. It’s the part prefixed with +:
  • A line with no trigger runs when the mob spawns (+onSpawn). MythicMobs’ own default is onCombat; the MythicMobs importer writes +onCombat on any imported line that had none, so imported skills behave as they did.
  • The on is optional: +hurt and +onHurt are the same trigger.
  • MythicMobs’ ~onHurt and the old #onHurt both still parse. A file that uses them is rewritten to + the next time it loads.
Why +? # is YAML’s comment character, so one hand edit that broke the loader’s quoting could silently turn a whole line into a comment. + means nothing to YAML.

@trigger and @target

Every trigger records who caused it, and @trigger targets that entity:
@target is the mob’s current AI target, falling back to the trigger entity when it has none. Most of the time those are the same entity; when a mob is chasing one player and gets hit by another, @trigger is the one who hit it. See Targeters.

Mob triggers

Player and item triggers

MythicMobs’ player and item triggers load without errors, so a line using one never fails to parse: +onUse, +onSwing, +onCrouch, +onUncrouch, +onConsume, +onBlockPlace, +onBlockBreak, +onFish, +onFishBite, +onFishCatch, +onFishGround, +onFishReel, +onFishFail, +onTridentThrow, +onTridentHit, +onEquip, +onUnequip, +onPressQ, +onPressCtrlQ, +onPressF, +onPress, +onRelease, +onJoin, +onRespawn, +onCast, +onCustom, +onBlock, +onPlayerDeath. Mobs never fire them on their own. An addon fires them through the API; see Extending the Effect Language.

Several lines, one trigger

Lines that share a trigger run top to bottom:

Triggers live on the calling line

Only a mob’s own effects: lines carry triggers. Lines inside a skill inherit the moment they were called from: the skill line has the trigger, the skill just runs.
To gate a line on what fired it, use a trigger condition: ?~isPlayer runs the line only when the trigger entity is a player. See Line Options.