when a condition holds, do an effect — and it is data,
so you can add it, read it back, and change it while the simulation runs. This guide covers
both the compact string form and the fully-typed declarative form.
Start a local server first — see the Quickstart. All commands target
http://localhost:3917; every POST sends Content-Type: application/json.Add a rule
The quickest way is the string DSL onPOST /rule/create:
when—death,timer:N(N seconds),health-below:N,score:N, orphase:NAME.filter—any,team:N, orentity:N.actions— space-separatedverb target amount, whereverb∈heal,damage,score,spawn,despawn,teleport,color,text,endgameandtarget∈this,source,entity:N.
/step, the engine evaluates every rule against the table and applies the
effects of those whose condition holds.
Change rules mid-run
Because rules are a live part of the world, you can add one while the simulation is running — no restart, no recompile:The fully-typed form
The DSL is shorthand. The complete data form is the rule list inside a scenario, where the condition and each action are typed values you can generate, diff, and store:{"kind": "<snake_case>", ...} — death, timer (+interval),
health_below (+threshold), score (+threshold), phase (+phase). Each action is
{"action": "...", "target": "this" | "source" | {"entity": N}, ...}. Because every part is
data, a world’s entire logic ships as a file you can read, diff, and re-apply.