Skip to content

Mob reactions

Reactions let a live mob respond to an event by executing a command block. In the mob template’s Reactions panel, choose an Event, enter the Reactions commands, configure Option when the event uses it, and add any Conditions.

Enter one command per line. The whole block uses the normal command timing rules: lines are executed in sequence, while semicolon-separated commands on one line are issued together. See Mob and room commands for syntax and timing, and Conditions for the condition language.

These are the 13 events currently available in the editor.

Event When it fires Option
Character enters mob’s room (enter) On an engine entrance notification. This includes ordinary movement, successful connection in the room, flee or transfer arrival, respawn, and becoming visible after sneaking. Optional reaction cooldown in seconds. Blank or a non-integer uses the standard 10-second gate.
Something is said (say) When any case-insensitive word token in the speech matches one of the space-separated tokens in Option. Punctuation does not make a partial word match. Required trigger words, such as hello greetings.
Time has elapsed (periodic) Repeats while that live mob exists. The first run is scheduled after the configured interval; later intervals vary by up to 10 percent so identical mobs do not remain synchronized. Every line in the reaction block runs on each occurrence—it does not choose a random line. Required whole-number interval in seconds. Use a positive value; there is no fallback interval when the field is omitted.
Mob loads (load) Schedules the reaction block about two seconds after a fresh mob is created. Each load reaction is scheduled. Unused.
Player connects (connect) When a player successfully connects in the mob’s room. A connect is also an entrance notification, so an enter reaction can compete with it. Optional reaction cooldown in seconds. Blank or a non-integer uses the standard 10-second gate.
Mob dies (death) After death processing begins. The dead mob no longer executes commands, so its room executes every eligible death reaction. Unused.
Item is received (receive) After a character successfully gives the mob at least one item whose template ID matches Option. Required item template ID.
Health drops below (health) When a hit crosses from above the configured percentage to at or below it. It does not repeatedly fire while health remains below the threshold, and the current health must remain above zero. Required whole-number health percentage.
Social is Received (social) When the mob receives the named social. Matching is case-insensitive and exact rather than token-based. Required social code, such as the name used to invoke that social.
Enter Combat (combat_enter) When the mob changes from out of combat to in combat. Every eligible reaction of this type runs. Unused.
Exit Combat (combat_exit) When the mob is removed from its combat fray and returns to standing. Every eligible reaction of this type runs; the mob’s combat-script position is also reset. Unused.
Mob enters a new room (new_room) Whenever the mob itself completes a move to another room, whether through ordinary roaming or another movement command. Every eligible reaction of this type runs. Unused.
Mob is notified (notify) When /notify <room_id> <mob_template_id> <message> selects this mob and the message exactly matches Option. If several live mobs of the template are in the room, /notify selects only the first one. Required, case-sensitive notification message.

For /notify syntax and examples, see /notify.

The object evaluated by Conditions depends on the event. The same context also determines {{ actor }} when that substitution is available.

Events Conditions evaluate against {{ actor }}
Character enters, Player connects, Something is said, Item is received, Social is Received The character who caused the event. That character.
Health drops below The reacting mob. The reacting mob.
Mob is notified The notified mob. The notified mob.
Time has elapsed, Enter Combat, Exit Combat, Mob enters a new room The reacting mob. No triggering actor is substituted into the command block.
Mob dies Normally the killer. The killer; the room executes the resulting commands.
Mob loads Load reactions do not evaluate their Conditions. No triggering actor is substituted into the command block.

This distinction matters for actor-specific conditions. For example, level 5 on Something is said checks the speaker’s level, while the same condition on Time has elapsed checks the mob’s level.

For Character enters, Player connects, Something is said, Item is received, Social is Received, and Health drops below, the engine scans the mob’s reactions and stops after the first one that actually produces commands. A reaction whose event, Option, or Conditions do not match falls through to later reactions.

This first-producing rule has two practical consequences:

  • overlapping speech keywords should be ordered and conditioned as alternatives rather than expected to all run;
  • a successful connection can match both Character enters and Player connects, but only the first one that produces commands wins for that notification.

Mob is notified similarly uses the first reaction whose notification text and conditions match. By contrast, separate Mob loads, Mob dies, Time has elapsed, Enter Combat, Exit Combat, and Mob enters a new room reactions can all execute for their event.

  1. Save the template and create a fresh copy with /load mob <template_id> or its loader.
  2. Trigger one event and confirm its Option matches what the runtime receives.
  3. If nothing happens, temporarily remove the conditions, then restore them one at a time.
  4. Check for an earlier overlapping reaction and for a cooldown gate that has not expired.
  5. For multi-line blocks, wait for the normal per-line command timing before deciding a later command failed.