editor.statetree
Six read-only methods for inspecting State Tree assets: the asset summary, the full states hierarchy, configurable parameters, the schema and context data requirements, registered extensions, and project-wide asset enumeration. AI agents reach through these methods to reason about AI behavior graphs without opening the State Tree editor.
Requires: the StateTreeModule runtime module must be loaded. Stock UE ships it enabled. If State Tree is not available, all methods return -32001 NotFound with guidance to enable the StateTree plugin.
Method summary
| Method | Mutating | Tier | Purpose |
|---|---|---|---|
getInfo | no | Free | Top-level asset summary: state/node counts, ready-to-run flag, schema class. |
getStates | no | Free | Full state hierarchy with depth, task/transition/condition counts. |
getParameters | no | Free | Configurable parameters exposed on the asset. |
getSchema | no | Free | Schema class + required context data structs. |
getExtensions | no | Free | Extensions registered on the State Tree. |
listAssets | no | Free | Project-wide asset enumeration, optional path filter. |
editor.statetree.getInfo
Returns basic information about a State Tree asset: state count, node count, ready-to-run flag, and schema class.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
asset_path | string | Yes | Full UObject path to the State Tree asset. |
Returns:
| Field | Type | Description |
|---|---|---|
asset_name | string | Asset name. |
asset_path | string | Echo of the input path. |
num_states | number | Number of states. |
num_nodes | number | Number of nodes. |
is_ready_to_run | bool | Whether the asset compiled successfully and is runnable. |
num_extensions | number | Number of registered extensions. |
num_external_data | number | External data requirements. |
schema_class | string | Schema class name. |
num_parameters | number | Number of parameters. |
Example Request:
{
"jsonrpc": "2.0", "id": 1,
"method": "editor.statetree.getInfo",
"params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
} Example Response:
{
"jsonrpc": "2.0", "id": 1,
"result": {
"asset_name": "ST_EnemyBehavior",
"asset_path": "/Game/AI/ST_EnemyBehavior.ST_EnemyBehavior",
"num_states": 14,
"num_nodes": 38,
"is_ready_to_run": true,
"num_extensions": 2,
"num_external_data": 1,
"schema_class": "StateTreeAIComponentSchema",
"num_parameters": 4
}
} editor.statetree.getStates
Returns every state in the State Tree hierarchy with its depth and per-state task, transition, and enter-condition counts. The parent_index field threads the array into a tree; root states carry has_parent: false.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
asset_path | string | Yes | Full UObject path to the State Tree asset. |
Returns:
| Field | Type | Description |
|---|---|---|
states | array | Each: {index, name, depth, num_tasks, num_transitions, num_enter_conditions, has_parent, parent_index}. |
count | number | Number of states. |
Example Request:
{
"jsonrpc": "2.0", "id": 2,
"method": "editor.statetree.getStates",
"params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
} Example Response:
{
"jsonrpc": "2.0", "id": 2,
"result": {
"states": [
{ "index": 0, "name": "Root", "depth": 0, "num_tasks": 0, "num_transitions": 0, "num_enter_conditions": 0, "has_parent": false, "parent_index": -1 },
{ "index": 1, "name": "Patrol", "depth": 1, "num_tasks": 2, "num_transitions": 1, "num_enter_conditions": 0, "has_parent": true, "parent_index": 0 },
{ "index": 2, "name": "Chase", "depth": 1, "num_tasks": 1, "num_transitions": 2, "num_enter_conditions": 1, "has_parent": true, "parent_index": 0 }
],
"count": 3
}
} editor.statetree.getParameters
Returns the State Tree's configurable parameters -- the public input surface callers pass in when instancing the tree.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
asset_path | string | Yes | Full UObject path. |
Returns:
| Field | Type | Description |
|---|---|---|
parameters | array | Each: {name, type, type_object}. |
count | number | Number of parameters. |
Example Request:
{
"jsonrpc": "2.0", "id": 3,
"method": "editor.statetree.getParameters",
"params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
} Example Response:
{
"jsonrpc": "2.0", "id": 3,
"result": {
"parameters": [
{ "name": "AggroRange", "type": "float", "type_object": "" },
{ "name": "PatrolPath", "type": "object", "type_object": "/Script/Engine.SplineComponent" }
],
"count": 2
}
} editor.statetree.getSchema
Returns the State Tree schema and its required context data. The schema constrains which evaluators and tasks the tree can host; the context data list is the runtime inputs a caller must provide.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
asset_path | string | Yes | Full UObject path. |
Returns:
| Field | Type | Description |
|---|---|---|
schema_class | string | Schema class name (e.g. StateTreeAIComponentSchema). |
schema_path | string | Full path to the schema class. |
context_data | array | Each: {name, struct_type}. |
num_context_data | number | Context data count. |
Example Request:
{
"jsonrpc": "2.0", "id": 4,
"method": "editor.statetree.getSchema",
"params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
} Example Response:
{
"jsonrpc": "2.0", "id": 4,
"result": {
"schema_class": "StateTreeAIComponentSchema",
"schema_path": "/Script/StateTreeModule.StateTreeAIComponentSchema",
"context_data": [ { "name": "Actor", "struct_type": "/Script/Engine.Actor" } ],
"num_context_data": 1
}
} editor.statetree.getExtensions
Returns extensions registered on the State Tree -- subsystems or components the tree hooks into at runtime.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
asset_path | string | Yes | Full UObject path. |
Returns:
| Field | Type | Description |
|---|---|---|
extensions | array | Each: {class, name}. |
count | number | Number of extensions. |
Example Request:
{
"jsonrpc": "2.0", "id": 5,
"method": "editor.statetree.getExtensions",
"params": { "asset_path": "/Game/AI/ST_EnemyBehavior" }
} Example Response:
{
"jsonrpc": "2.0", "id": 5,
"result": {
"extensions": [
{ "class": "StateTreeAIExtension", "name": "AI" }
],
"count": 1
}
} editor.statetree.listAssets
Lists all State Tree assets in the project. Accepts an optional substring filter on the package path.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
path_filter | string | No | Return only assets whose path contains this substring. |
Returns:
| Field | Type | Description |
|---|---|---|
assets | array | Each: {name, path}. |
count | number | Number of State Tree assets returned. |
Example Request:
{ "jsonrpc": "2.0", "id": 6, "method": "editor.statetree.listAssets" } Example Response:
{
"jsonrpc": "2.0", "id": 6,
"result": {
"assets": [
{ "name": "ST_EnemyBehavior", "path": "/Game/AI/ST_EnemyBehavior.ST_EnemyBehavior" },
{ "name": "ST_NPCGreeter", "path": "/Game/AI/ST_NPCGreeter.ST_NPCGreeter" }
],
"count": 2
}
} Related
- API Reference index
- editor.blueprint -- Blueprint graph manipulation, including event graphs that call into State Trees