build.get_mode_state
Overview
- Returns whether build mode is active and which lifecycle phase it is in. Entering is asynchronous (packet round-trip, streaming grid load, scene transition, then object spawn completion), so poll until phase == 'ready' before issuing any building.* command. A transient 'none' can appear during the streaming step before the loading UI is shown; do not immediately re-issue build.enter_mode on a single 'none' reading. If phase stays 'leaving', check the 'stuck' field.
Metadata
| Field | Value |
|---|---|
| Display | Get Build Mode State |
| Category | build |
| Access | Public |
| Scope | B1Standalone |
| Tags | Experimental |
| Aliases | — |
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| include_options | bool | no | false | Also embed the build option flags (same set as building.get_options). Only present while a build mode pawn exists. |
Returns
Returns a JSON object with the following fields:
| Field | Type | Required | Description |
|---|---|---|---|
in_build_mode | bool | yes | Whether the build view scene is active |
phase | string | yes | none | entering | preparing | ready | leaving |
site_id | string | yes | Target site id (empty if none) |
site_entity_id | entityId | yes | Target site entity id |
editable | bool | yes | Whether editing is enabled (EDITABLE state bit) |
pending | bool | yes | Whether a build-mode entry is in flight |
selection_mode | string | yes | Current build tool sub-mode |
selected_count | int | yes | Number of currently selected game objects |
customizing_floor | int | yes | Floor level currently being edited |
has_undo | bool | yes | Whether building.undo is available |
has_redo | bool | yes | Whether building.redo is available |
stuck | bool | no | Present only when the exit gate has not opened within the threshold |
leaving_elapsed_sec | float | no | Seconds spent in the 'leaving' phase (only when stuck) |
stuck_hint | string | no | Diagnostic hint (only when stuck) |
options | object | no | Build option flags (only when include_options=true and a build mode pawn exists) |
options.free_location | bool | yes | Free placement without snapping |
options.grid_snap | bool | yes | Snap to grid |
options.object_snap | bool | yes | Snap to other objects |
options.uniform_scaling | bool | yes | Uniform scaling |
options.smart_guide | bool | yes | Smart alignment guides |
options.delete_mode | bool | yes | Delete mode enabled |
options.continuous_placement | bool | yes | Continuous placement |
Usage
await inzoi.cli.execute('build.get_mode_state', {
include_options: false, // optional
});