insert_event_commands
Insert pre-built event command sequences into RPG Maker MZ command lists, targeting map events, common events, or troop pages, with validation to prevent structural errors.
Instructions
Insert a pre-built sequence of event commands (from the build_* builders) into any of the three command lists an MZ project has — the mutating companion to the read-only builders. Splices before the list’s end marker (or at position). target "map_event" (the default) needs mapId + eventId + pageIndex; "common_event" needs commonEventId; "troop_page" needs troopId + pageIndex. The resulting list is validated before writing: a structural problem (wrong parameter count for a command code, a list left unterminated) refuses the write and saves nothing — pass force: true to override. Advisory findings (unrecognized code, over-long text line) are returned as warnings and never block. Returns { target, id, listLength, listCodes, warnings? } — the resulting list as its length and its command CODES, which is what you verify a splice against; pass verbose: true for the full list with parameters, or read it back with get_map_event.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| force | No | Write even if validation finds structural problems (wrong parameter count, unterminated command list). Off by default: such a write is refused and nothing is written. Advisory warnings never block regardless. | |
| mapId | No | target "map_event": the map id | |
| dryRun | No | Preview only: return a diff of what would change without writing to disk. | |
| target | No | Which command list to insert into (default map_event) | |
| eventId | No | target "map_event": the event id | |
| troopId | No | target "troop_page": the troop id | |
| verbose | No | Echo the full written record instead of the default summary. Off by default: the response reports identity, counts and command-list shape, which is what you would assert on, and omits the parameters/conditions you would only re-read. Read the full record with the matching get_* tool. | |
| commands | Yes | The event commands to insert (e.g. the `commands` from a build_* tool) | |
| position | No | Insertion index; defaults to the end of the list | |
| pageIndex | No | target "map_event"/"troop_page": zero-based page index | |
| commonEventId | No | target "common_event": the common event id |