create_common_event
Create a reusable common event in RPG Maker MZ's CommonEvents.json, allocating the next unused ID from just a name. Optionally include a command list, trigger, and switch, with validation and dry-run preview.
Instructions
Create a new common event (reusable event-command list) in data/CommonEvents.json. Only name is required; omitted fields use the editor's new-slot defaults (empty command list, trigger 0 = call-only, switchId 1). Allocates and returns the next unused id. A structurally invalid command list refuses the write (nothing is saved) — pass force: true to override.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list | No | Event-command list { code, indent, parameters }; must end with code 0 | |
| name | Yes | Common event name shown in the database | |
| 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. | |
| dryRun | No | Preview only: return a diff of what would change without writing to disk. | |
| trigger | No | How it runs on its own: 0 None (call-only), 1 Autorun, 2 Parallel | |
| switchId | No | Switch that gates an Autorun/Parallel trigger (ignored when trigger is 0) |