Skip to main content Crate bevy_gearbox Copy item path Source commands components core delay helpers history messages parameters prelude registration resolve server state_component AcceptAll Default validator that accepts all messages. Active Marker inserted on state entities that are currently active. AlwaysEdge Marker: this edge fires automatically when its source is active. BoolEquals Boolean equality condition on an edge. BoolParam A strongly-typed boolean parameter. BoolParamBindingInstaller BoolParamInstaller DeferEvent Add to a state to defer messages of type M while that state is active.
When the state exits, the deferred message is replayed. Delay Delayed transition: fire after duration elapses while the source is active. Done Emitted when a TerminalState is entered.
Targets the parent state so MessageEdge<Done> on the parent can fire. EdgeTimer Active timer for a delayed edge. Created when the source state is entered,
removed when exited. Ticked in Update after [GearboxSet]. EnterState Triggered on a state entity after the schedule converges.
Use On<EnterState> observers on state entities to react. ExitState Triggered on a state entity after the schedule converges.
Use On<ExitState> observers on state entities to react. FloatInRange Float range condition on an edge. FloatParam A strongly-typed float parameter stored on the machine root entity. FloatParamBindingInstaller FloatParamInstaller GearboxPlugin GearboxSchedule The schedule that resolves state machine transitions. Runs N times per
frame inside [run_gearbox_schedule]. GearboxSet System set in Update that contains the gearbox schedule runner.
Use this for ordering user systems relative to gearbox resolution: Guards Guard conditions that block a transition. Edge fires only when empty. HistoryState Stores the previously active states for history restoration.
Automatically managed by resolve_transitions . InitialState Which child state to enter by default when a parent state is entered. InstalledBoolParamBindings InstalledBoolParams InstalledFloatParamBindings InstalledFloatParams InstalledIntParamBindings InstalledIntParams InstalledStateBridges InstalledStateComponents Deduplication resource for registered state components. InstalledTransitions Deduplication resource for registered message types. IntInRange Integer range condition on an edge. IntParam A strongly-typed integer parameter. IntParamBindingInstaller IntParamInstaller IterationCap Maximum number of iterations the schedule will run per frame.
If hit, a warning is logged — this likely indicates a transition loop. Matched Written by message_edge_listener when a message of type M successfully
matches an edge and produces a TransitionMessage . Carries the original
message along with the transition context. MessageEdge Attach to a transition edge to make it react to messages of type M. ResetEdge Marker to request reset of subtree(s) when an edge fires. Source Source state of a transition edge. StateBridgeInstaller StateComponent When added to a state entity, inserts T on the machine root when this
state is entered and removes it when this state is exited. StateInactiveComponent When added to a state entity, removes T from the machine root when this
state is entered and restores the stored clone when this state is exited. StateInstaller StateMachine Marks an entity as a state machine root and tracks active states. SubstateOf Relationship: this state is a substate of another. Substates Relationship target: children substates. Target Target state of a transition edge. TerminalState Marks a state as terminal (XState “final state”). When entered, a [Done]
message is emitted targeting the parent state (via SubstateOf ). The
parent can then transition out via a MessageEdge<Done>. TransitionBuilder Builder for guarded always-transitions. TransitionInstaller TransitionMessage A pending transition to be resolved by the schedule. Transitions Outbound edges from a state. EdgeKind Whether a transition is External (default, exits/re-enters the LCA) or
Internal (stays within the source state, no exit/re-enter of the LCA). GearboxPhase System sets within GearboxSchedule , executed in order each iteration. History Enables history behavior for a state. When a state with this component is
exited and later re-entered, it restores previously active substates
instead of following InitialState . ResetScope Which side of the transition to reset. BoolParamBinding Bind a source component T to a bool param. BuildEntityEvent Helper trait to build and trigger an event given a root entity. BuildTransition Extension trait for building guarded always-transitions. FloatParamBinding Bind a source component T to a float param. GearboxCommandsExt Commands helper to interact with a state machine found by a marker component. GearboxMessage Trait implemented by user message types that can trigger state machine
transitions. The schedule version of core’s TransitionEvent. Guard Trait for types that can identify a guard by name. GuardProvider A component that acts as a guard provider. When inserted on a transition
edge, it manages a named guard in the Guards set. InitStateMachine Extension for initializing a state machine on an existing entity. IntParamBinding Bind a source component T to an int param. MessageValidator Per-edge filter that accepts or rejects a message for a specific edge. RegistrationAppExt Extension trait for registering message-driven transitions, state
components, parameters, and bridges with the gearbox schedule. SideEffect Pure data transform: produce a side-effect message from a matched transition. SpawnSubstate Extension trait for spawning substates with less boilerplate. SpawnTransition Extension trait for spawning transitions. TransitionExt Extension methods for transition entities. apply_bool_param_guards Update Guards on edges with BoolEquals<P>. apply_float_param_guards Update Guards on edges with FloatInRange<P>. apply_int_param_guards Update Guards on edges with IntInRange<P>. bridge_to_bevy_state Sync gearbox state into Bevy’s NextState<S> when a state with component
S is entered. Runs in Update after GearboxSet . emit_terminal_done System that emits Done messages when a TerminalState gains Active .
Runs in [GearboxPhase::EntryPhase]. gearbox_auto_register_plugin Function-style plugin to run inventory-based auto-registrations. init_bool_param_guard_on_add Seed a blocking guard when BoolEquals<P> is added to an edge. init_float_param_guard_on_add Seed a blocking guard when FloatInRange<P> is added to an edge. init_int_param_guard_on_add Seed a blocking guard when IntInRange<P> is added to an edge. message_edge_listener System that reads incoming messages of type M, finds matching edges on
active states (leaf-first, walk ancestors), and writes TransitionMessage s
and Matched<M> messages. produce_side_effects System that reads Matched<M> messages and writes side-effect messages.
Registered by RegistrationAppExt::register_side_effect . replay_deferred_messages Replay deferred messages when their host state exits.
Runs in Update after GearboxSet — replayed messages are picked up next frame. state_component_enter Insert T on the machine root when a state with StateComponent<T> is entered. state_component_exit Remove T from the machine root when a state with StateComponent<T> is exited. state_inactive_component_enter Remove T from the machine root when a state with StateInactiveComponent<T> is entered. state_inactive_component_exit Restore T on the machine root when a state with StateInactiveComponent<T> is exited. sync_bool_param Sync T → BoolParam<P>. sync_float_param Sync T → FloatParam<P>. sync_int_param Sync T → IntParam<P>. gearbox_message Attribute macro that turns a struct into a gearbox transition message. gearbox_param Attribute macro to auto-register a parameter with guard wiring and optional sync binding. side_effect Attribute macro to auto-register a side effect via inventory. state_bridge Attribute macro to auto-register a Bevy States bridge via inventory. state_component Attribute macro to auto-register a state component type via inventory. transition_message Attribute macro to auto-register a transition message type via inventory.