Skip to main content

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

FieldValue
DisplayGet Build Mode State
Categorybuild
AccessPublic
ScopeB1Standalone
TagsExperimental
Aliases—

Parameters

NameTypeRequiredDefaultDescription
include_optionsboolnofalseAlso 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:

FieldTypeRequiredDescription
in_build_modeboolyesWhether the build view scene is active
phasestringyesnone | entering | preparing | ready | leaving
site_idstringyesTarget site id (empty if none)
site_entity_identityIdyesTarget site entity id
editableboolyesWhether editing is enabled (EDITABLE state bit)
pendingboolyesWhether a build-mode entry is in flight
selection_modestringyesCurrent build tool sub-mode
selected_countintyesNumber of currently selected game objects
customizing_floorintyesFloor level currently being edited
has_undoboolyesWhether building.undo is available
has_redoboolyesWhether building.redo is available
stuckboolnoPresent only when the exit gate has not opened within the threshold
leaving_elapsed_secfloatnoSeconds spent in the 'leaving' phase (only when stuck)
stuck_hintstringnoDiagnostic hint (only when stuck)
optionsobjectnoBuild option flags (only when include_options=true and a build mode pawn exists)
options.free_locationboolyesFree placement without snapping
options.grid_snapboolyesSnap to grid
options.object_snapboolyesSnap to other objects
options.uniform_scalingboolyesUniform scaling
options.smart_guideboolyesSmart alignment guides
options.delete_modeboolyesDelete mode enabled
options.continuous_placementboolyesContinuous placement

Usage

await inzoi.cli.execute('build.get_mode_state', {
include_options: false, // optional
});