add-region-behavior
Add one validated behavior to an existing region: teleport, active effect, difficult terrain, rotation, and more. Resolves teleport destinations and warns on off-grid landing pads.
Instructions
Add ONE behavior to an EXISTING region — the write create-region only offers at creation time and update-region deliberately never touches. Creates a real RegionBehavior embedded document (validated against the registered behavior types). For teleporters, pass teleportTo {sceneIdentifier, regionIdentifier} and the destination UUID is resolved for you; the landing region's geometry is then sanity-checked and you are WARNED when it contains no grid-snapped token position (the silent teleport no-op: off-grid pads). GM-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Behavior label (defaults to the type's standard name). | |
| type | Yes | Behavior type key, validated against the live registry — core v14: teleportToken, executeMacro, executeScript, adjustDarknessLevel, changeLevel, displayScrollingText, modifyMovementCost, pauseGame, suppressWeather, toggleBehavior, defineSurface; dnd5e 6.0: dnd5e.applyActiveEffect (an area that applies effects to tokens inside it — lava, a poison cloud, consecrated ground; use `effects`), dnd5e.difficultTerrain (use `terrainTypes` / `magical`), dnd5e.rotateArea (a turning platform — use `rotate`). | |
| sizes | No | applyActiveEffect: only creatures of these sizes (omit = all). | |
| rotate | No | dnd5e.rotateArea: a turning platform / puzzle room — the listed placeables (ids from list-tiles / list-walls / list-lights / list-regions / list-sounds, validated to exist on the scene) rotate together around the region's first shape, stopping at `positions`. A turn is triggered from the region config or a script, not by walking in. | |
| system | No | Behavior system data carried verbatim (the v14 shape for the type) — e.g. executeMacro {uuid}, adjustDarknessLevel {mode, modifier}. | |
| effects | No | dnd5e.applyActiveEffect: the effects applied on entry and removed on exit. Each is a NAME from the stock dnd5e.effects pack ("Poisoned", "Prone", "Fire Resistance", "Blinded" …) or from a world item's effects, an ActiveEffect uuid, or an Item uuid + "#<effect name>" (a premium-pack spell's effect). Never an effect on an actor. Resolved and echoed back. | |
| magical | No | difficultTerrain: magical terrain (Spike Growth) vs mundane (rubble). Default false. | |
| disabled | No | Create the behavior disabled (default false). | |
| teleportTo | No | teleportToken convenience: resolve this scene+region to the destination UUID and append it to system.destinations — no hand-built "Scene.<id>.Region.<id>" needed. A teleportToken with system.choice unset defaults to choice:true (the confirm-before-moving house pattern); pass system.choice:false explicitly for silent trap/plot teleports. | |
| dispositions | No | applyActiveEffect: only tokens with these dispositions are affected (omit = all). difficultTerrain: these dispositions IGNORE the terrain. | |
| terrainTypes | No | difficultTerrain: what kind of terrain it is (a creature may ignore some kinds — e.g. web, plants, ice). Omit for generic difficult terrain. | |
| creatureTypes | No | applyActiveEffect: only these creature types (omit = all). | |
| sceneIdentifier | Yes | Scene id or exact name holding the region. | |
| regionIdentifier | Yes | Region id or EXACT region name on that scene (an ambiguous name errors — use the id). |