Entity AI goal reference (23/41)
This page carries the AI goal (behavior) pages of MS Learn (MicrosoftDocs/minecraft-creator a9fd1c0, CC BY 4.0). IDs, property names, types, default values and JSON are as in the original. The full list is in the index.
minecraft:behavior.melee_attack
(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_melee_attack.md)
Allows an entity to deal damage through a melee attack.
[!Note] In 1.26.0 the schema is stricter and rejects invalid JSON for this behavior.
[!Note] Requires a target in order to work properly. Entities can generate targets via one of the following behaviors:
Nearest Attackable Target Behavior (minecraft:behavior.nearest_attackable_target)
Hurt By Target Behavior (minecraft:behavior.hurt_by_target) [!Note] Requires the following component in order to work properly:
Attack (minecraft:attack)
Entity Melee Attack Behavior Properties
| Name | Default Value | Type | Description |
|---|---|---|---|
| attack_once | false | Boolean true/false | Allows the mob to perform this melee attack behavior only once during its lifetime. |
| attack_types | String | Defines the entity types this entity will attack. | |
| can_spread_on_fire | false | Boolean true/false | Allows the mob, if on fire and empty handed, to ignite its target upon a successful attack. |
| control_flags | [] | Control Flags choices | |
| cooldown_time | 1 | Decimal number | Cooldown time, in seconds, between consecutive attacks. |
| inner_boundary_time_increase | 0.25 | Decimal number | Time, in seconds, added to the attack path recalculation interval when the target is beyond "path_inner_boundary". |
| max_path_time | 0.550000011920929 | Decimal number | Maximum base time, in seconds, before recalculating a new attack path to the target (before increases are applied). |
| melee_fov | 90 | Decimal number | Field of view, in degrees, used by the hard-coded sensing component to detect a valid attack target. |
| min_path_time | 0.20000000298023224 | Decimal number | Minimum base time, in seconds, before recalculating a new attack path to the target (before increases are applied). |
| on_attack | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | Attack item | Defines the event to trigger when this entity successfully attacks. |
| on_kill | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | Kill item | Defines the event to trigger when this entity kills the target. |
| outer_boundary_time_increase | 0.5 | Decimal number | Time, in seconds, added to the attack path recalculation interval when the target is beyond "path_outer_boundary". |
| path_fail_time_increase | 0.75 | Decimal number | Time, in seconds, added to the attack path recalculation interval when the mob cannot move along the current path. |
| path_inner_boundary | 16 | Decimal number | Distance at which to increase attack path recalculation by "inner_boundary_time_increase". |
| path_outer_boundary | 32 | Decimal number | Distance at which to increase attack path recalculation by "outer_boundary_time_increase". |
| priority | 0 | Integer number | As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. |
| random_stop_interval | 0 | Integer number | Defines a 1-in-N chance for the mob to stop its current attack, where N equals "random_stop_interval". |
| reach_multiplier | 2 | Decimal number | Used with the base size of the entity to determine minimum target-distance before trying to deal attack damage. |
| require_complete_path | false | Boolean true/false | Specifies whether a full navigation path from the mob to the target is required. |
| speed_multiplier | 1 | Decimal number | Multiplier applied to the mob's movement speed when moving toward its target. |
| track_target | false | Boolean true/false | Allows the mob to track its target even if it lacks a hard-coded sensing component. |
| x_max_rotation | 30 | Decimal number | Maximum rotation, in degrees, on the X-axis while the mob is trying to look at its target. |
| y_max_head_rotation | 30 | Decimal number | Maximum rotation, in degrees, on the Y-axis while the mob is trying to look at its target. |
Control Flags choices
| Value | Title | Description |
|---|---|---|
| jump | Jump | |
| look | Look | |
| move | Move |
Entity ActorDefinitionTrigger
Triggers an entity event when specified conditions are met. Events activate component groups that change entity behavior—transforming villagers into zombie villagers, switching mobs to aggressive mode, or triggering growth stages. Combine with filters to create conditional state machines that respond to gameplay.
Entity ActorDefinitionTrigger Properties
JSON path: on_attack
| Name | Default Value | Type | Description |
|---|---|---|---|
| event | String | ||
| filters (Filters) | {"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null} | Filters item | Filters allow data objects to specify test criteria which allows their use. |
| filters (Alternate 1) | not set | Object | |
| target | self | Target choices |
filters
Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.
Filters
Filters Properties
JSON path: on_attack > filters
| Name | Default Value | Type | Description |
|---|---|---|---|
| domain | not set | Object | The domain the test should be performed in. |
| operator | not set | Object | The comparison to apply with 'value'. |
| subject | not set | Object | The subject of this filter test. |
| test | not set | String | The name of the test to apply. |
| value | not set | Object | The value being compared with the test. |
Target choices
| Value | Title | Description |
|---|---|---|
| baby | Baby | |
| block | Block | |
| damager | Damager | |
| holder | Holder | |
| item | Item | |
| other | Other | |
| parent | Parent | |
| player | Player | |
| self | Self | |
| target | Target |
Samples
minecraft:behavior.melee_box_attack
(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_melee_box_attack.md)
Allows an entity to deal damage through a melee attack with reach calculations based on bounding boxes.
[!Note] In 1.26.0 the schema is stricter and rejects invalid JSON for this behavior.
Entity Melee Box Attack Behavior Properties
| Name | Default Value | Type | Description | Example Values |
|---|---|---|---|---|
| attack_once | false | Boolean true/false | Allows the mob to perform this melee attack behavior only once during its lifetime. | |
| attack_types | String | Defines the entity types this entity will attack. | ||
| can_spread_on_fire | false | Boolean true/false | Allows the mob, if on fire and empty handed, to ignite its target upon a successful attack. | Drowned: true |
| control_flags | [] | Control Flags choices | ||
| cooldown_time | 1 | Decimal number | Cooldown time, in seconds, between consecutive attacks. | |
| horizontal_reach | 0.800000011920929 | Decimal number | The attack reach of the mob will be a box with the size of the mobs bounds increased by this value in all horizontal directions. | |
| inner_boundary_time_increase | 0.25 | Decimal number | Time, in seconds, added to the attack path recalculation interval when the target is beyond "path_inner_boundary". | |
| max_path_time | 0.550000011920929 | Decimal number | Maximum base time, in seconds, before recalculating a new attack path to the target (before increases are applied). | |
| melee_fov | 90 | Decimal number | Field of view, in degrees, used by the hard-coded sensing component to detect a valid attack target. | |
| min_path_time | 0.20000000298023224 | Decimal number | Minimum base time, in seconds, before recalculating a new attack path to the target (before increases are applied). | |
| on_attack | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | Attack item | Defines the event to trigger when this entity successfully attacks. | |
| on_kill | {"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"} | Kill item | Defines the event to trigger when this entity kills the target. | |
| outer_boundary_time_increase | 0.5 | Decimal number | Time, in seconds, added to the attack path recalculation interval when the target is beyond "path_outer_boundary". | |
| path_fail_time_increase | 0.75 | Decimal number | Time, in seconds, added to the attack path recalculation interval when the mob cannot move along the current path. | |
| path_inner_boundary | 16 | Decimal number | Distance at which to increase attack path recalculation by "inner_boundary_time_increase". | |
| path_outer_boundary | 32 | Decimal number | Distance at which to increase attack path recalculation by "outer_boundary_time_increase". | |
| priority | 0 | Integer number | As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. | Blaze: 3, Bogged: 4, Dolphin: 2 |
| random_stop_interval | 0 | Integer number | Defines a 1-in-N chance for the mob to stop its current attack, where N equals "random_stop_interval". | Cave Spider: 100 |
| require_complete_path | false | Boolean true/false | Specifies whether a full navigation path from the mob to the target is required. | Drowned: true |
| speed_multiplier | 1 | Decimal number | Multiplier applied to the mob's movement speed when moving toward its target. | Bogged: 1.25 |
| track_target | false | Boolean true/false | Allows the mob to track its target even if it lacks a hard-coded sensing component. | Bogged: true |
| x_max_rotation | 30 | Decimal number | Maximum rotation, in degrees, on the X-axis while the mob is trying to look at its target. | |
| y_max_head_rotation | 30 | Decimal number | Maximum rotation, in degrees, on the Y-axis while the mob is trying to look at its target. |
Control Flags choices
| Value | Title | Description |
|---|---|---|
| jump | Jump | |
| look | Look | |
| move | Move |
Entity ActorDefinitionTrigger
Triggers an entity event when specified conditions are met. Events activate component groups that change entity behavior—transforming villagers into zombie villagers, switching mobs to aggressive mode, or triggering growth stages. Combine with filters to create conditional state machines that respond to gameplay.
Entity ActorDefinitionTrigger Properties
JSON path: on_attack
| Name | Default Value | Type | Description |
|---|---|---|---|
| event | String | ||
| filters (Filters) | {"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null} | Filters item | Filters allow data objects to specify test criteria which allows their use. |
| filters (Alternate 1) | not set | Object | |
| target | self | Target choices |
filters
Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.
Filters
Filters Properties
JSON path: on_attack > filters
| Name | Default Value | Type | Description |
|---|---|---|---|
| domain | not set | Object | The domain the test should be performed in. |
| operator | not set | Object | The comparison to apply with 'value'. |
| subject | not set | Object | The subject of this filter test. |
| test | not set | String | The name of the test to apply. |
| value | not set | Object | The value being compared with the test. |
Target choices
| Value | Title | Description |
|---|---|---|
| baby | Baby | |
| block | Block | |
| damager | Damager | |
| holder | Holder | |
| item | Item | |
| other | Other | |
| parent | Parent | |
| player | Player | |
| self | Self | |
| target | Target |
Samples
Blaze
"minecraft:behavior.melee_box_attack": {
"priority": 3
}
Bogged
"minecraft:behavior.melee_box_attack": {
"speed_multiplier": 1.25,
"track_target": true,
"priority": 4
}
Cave Spider
At /minecraft:entity/component_groups/minecraft:spider_angry/minecraft:behavior.melee_box_attack/:
"minecraft:behavior.melee_box_attack": {
"track_target": true,
"priority": 3
}
At /minecraft:entity/component_groups/minecraft:spider_hostile/minecraft:behavior.melee_box_attack/:
"minecraft:behavior.melee_box_attack": {
"random_stop_interval": 100,
"track_target": true,
"priority": 3
}
Dolphin
"minecraft:behavior.melee_box_attack": {
"priority": 2,
"track_target": true
}
Drowned
"minecraft:behavior.melee_box_attack": {
"can_spread_on_fire": true,
"require_complete_path": true,
"priority": 3
}
minecraft:behavior.mingle
(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_mingle.md)
Allows an entity to go to the village bell and mingle with other entities.
Entity Mingle Behavior Properties
| Name | Default Value | Type | Description |
|---|---|---|---|
| control_flags | [] | Control Flags choices | |
| cooldown_time | 0 | Decimal number | Time in seconds the mob has to wait before using the goal again |
| duration | 1 | Decimal number | Amount of time in seconds that the entity will chat with another entity |
| mingle_distance | 2 | Decimal number | The distance from its partner that this entity will mingle. If the entity type is not the same as the entity, this value needs to be identical on both entities. |
| mingle_partner_type | String | The entity type that this entity is allowed to mingle with | |
| priority | 0 | Integer number | As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. |
| speed_multiplier | 1 | Decimal number | Movement speed multiplier of the mob when using this goal. |
Control Flags choices
| Value | Title | Description |
|---|---|---|
| jump | Jump | |
| look | Look | |
| move | Move |
Samples
minecraft:behavior.mount_pathing
(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_mount_pathing.md)
Allows the mob to move around on its own while mounted seeking a target to attack. Also will allow an entity to target another entity for an attack.
Entity Mount Pathing Behavior Properties
| Name | Default Value | Type | Description | Example Values |
|---|---|---|---|---|
| control_flags | [] | Control Flags choices | ||
| priority | 0 | Integer number | As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. | Cave Spider: 5, Chicken: 2, Llama: 1 |
| speed_multiplier | 1 | Decimal number | Movement speed multiplier of the mob when using this AI Goal | Cave Spider: 1.25, Chicken: 1.5 |
| target_dist | 0 | Decimal number | The distance at which this mob wants to be away from its target | |
| track_target | false | Boolean true/false | If true, this mob will chase after the target as long as it's a valid target | Cave Spider: true |
Control Flags choices
| Value | Title | Description |
|---|---|---|
| jump | Jump | |
| look | Look | |
| move | Move |
Samples
Cave Spider
"minecraft:behavior.mount_pathing": {
"priority": 5,
"target_dist": 0,
"speed_multiplier": 1.25,
"track_target": true
}
Chicken
"minecraft:behavior.mount_pathing": {
"priority": 2,
"speed_multiplier": 1.5,
"target_dist": 0,
"track_target": true
}
Llama
"minecraft:behavior.mount_pathing": {
"priority": 1,
"speed_multiplier": 1.25,
"target_dist": 0,
"track_target": true
}
minecraft:behavior.move_around_target
(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_move_around_target.md)
Allows an entity to move around a target.If the entity is too close(i.e.closer than destination range min and height difference limit) it will try to move away from its target.If the entity is too far away from its target it will try to move closer to a random position within the destination range.A randomized amount of those positions will be behind the target, and the spread can be tweaked with 'destination_pos_spread_degrees'.
[!Note] In format version 1.26.20,
destination_position_rangemust be specified as a Float Range object (an object withrange_min/range_max). Legacy scalar or array forms no longer parse.
[!Note] This item requires a format version of at least 1.21.30.
Entity Move Around Target Behavior Properties
| Name | Default Value | Type | Description | Example Values |
|---|---|---|---|---|
| control_flags | [] | Control Flags choices | ||
| destination_pos_spread_degrees | 90 | Decimal number | This angle (in degrees) is used for controlling the spread when picking a destination position behind the target. | Breeze: 360 |
| destination_position_range | {"max":8,"min":4} | Destination Position Range item | The range of distances from the target entity within which the goal should look for a position to move the owner entity to. | Breeze: {"min":4,"max":8} |
| filters (Filters) | {"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null} | Filters item | Conditions that need to be met for the behavior to start. | Breeze: {"all_of":[{"test":"on_ground","value":true},{"operator":"<=","test":"target_distance","subject":"self","value":24}]} |
| filters (Alternate 1) | not set | Object | ||
| height_difference_limit | 10 | Decimal number | Distance in height (in blocks) between the owner entity and the target has to be less than this value when owner checks if it is too close and should move away from the target. | |
| horizontal_search_distance | 5 | Integer number | Horizontal search distance (in blocks) when searching for a position to move away from target. | |
| movement_speed | 0.6000000238418579 | Decimal number | The speed with which the entity should move to its target position. | Breeze: 1.2 |
| priority | 0 | Integer number | As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. | Breeze: 3 |
| vertical_search_distance | 5 | Integer number | Vertical search distance (in blocks) when searching for a position to move away from target. |
destination_pos_spread_degrees
This angle (in degrees) is used for controlling the spread when picking a destination position behind the target. A zero spread angle means the destination position will be straight behind the target with no variance. A 90 degree spread angle means the destination position can be up to 45 degrees to the left and to the right of the position straight behind the target's view direction.
height_difference_limit
Distance in height (in blocks) between the owner entity and the target has to be less than this value when owner checks if it is too close and should move away from the target. This value needs to be bigger than zero for the move away logic to trigger.
Control Flags choices
| Value | Title | Description |
|---|---|---|
| jump | Jump | |
| look | Look | |
| move | Move |
Legacy FloatRange
Legacy FloatRange Properties
JSON path: destination_position_range
| Name | Default Value | Type | Description |
|---|---|---|---|
| max | 0 | Decimal number | |
| min | 0 | Decimal number |
Filters
Filters Properties
JSON path: filters
| Name | Default Value | Type | Description |
|---|---|---|---|
| domain | not set | Object | The domain the test should be performed in. |
| operator | not set | Object | The comparison to apply with 'value'. |
| subject | not set | Object | The subject of this filter test. |
| test | not set | String | The name of the test to apply. |
| value | not set | Object | The value being compared with the test. |
Samples
Breeze
"minecraft:behavior.move_around_target": {
"destination_pos_spread_degrees": 360,
"destination_position_range": {
"min": 4,
"max": 8
},
"priority": 3,
"filters": {
"all_of": [
{
"test": "on_ground",
"value": true
},
{
"operator": "<=",
"test": "target_distance",
"subject": "self",
"value": 24
}
]
},
"height_difference_limit": 0,
"movement_speed": 1.2
}
minecraft:behavior.move_indoors
(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_move_indoors.md)
Allows this entity to move indoors.
Entity Move Indoors Behavior Properties
| Name | Default Value | Type | Description |
|---|---|---|---|
| control_flags | [] | Control Flags choices | |
| priority | 0 | Integer number | As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. |
| speed_multiplier | 0.800000011920929 | Decimal number | The movement speed modifier to apply to the entity while it is moving indoors. |
| timeout_cooldown | 8 | Decimal number | The cooldown time in seconds before the goal can be reused after pathfinding fails |
Control Flags choices
| Value | Title | Description |
|---|---|---|
| jump | Jump | |
| look | Look | |
| move | Move |
Samples
minecraft:behavior.move_outdoors
(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_move_outdoors.md)
Allows this entity to move outdoors.
Entity Move Outdoors Behavior Properties
| Name | Default Value | Type | Description |
|---|---|---|---|
| control_flags | [] | Control Flags choices | |
| goal_radius | 2 | Decimal number | The radius away from the target block to count as reaching the goal |
| priority | 0 | Integer number | As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. |
| search_count | 10 | Integer number | The amount of times to try finding a random outdoors position before failing |
| search_height | 5 | Integer number | The y range to search for an outdoors position for |
| search_range | 15 | Integer number | The x and z range to search for an outdoors position for |
| speed_multiplier | 0.5 | Decimal number | The movement speed modifier to apply to the entity while it is moving outdoors |
| timeout_cooldown | 8 | Decimal number | The cooldown time in seconds before the goal can be reused after pathfinding fails |
Control Flags choices
| Value | Title | Description |
|---|---|---|
| jump | Jump | |
| look | Look | |
| move | Move |
Samples
minecraft:behavior.move_through_village
(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_move_through_village.md)
Can only be used by Villagers. Allows the villagers to create paths around the village.
Entity Move Through Village Behavior Properties
| Name | Default Value | Type | Description | Example Values |
|---|---|---|---|---|
| control_flags | [] | Control Flags choices | ||
| only_at_night | false | Boolean true/false | If true, the mob will only move through the village during night time | Iron Golem: true |
| priority | 0 | Integer number | As priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal. | Iron Golem: 3 |
| speed_multiplier | 1 | Decimal number | Movement speed multiplier of the mob when using this AI Goal | Iron Golem: 0.6 |
Control Flags choices
| Value | Title | Description |
|---|---|---|
| jump | Jump | |
| look | Look | |
| move | Move |
Samples
Iron Golem
"minecraft:behavior.move_through_village": {
"only_at_night": true,
"priority": 3,
"speed_multiplier": 0.6
}
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
ms-learn | Minecraft Creator documentation (Microsoft Learn) | CC BY 4.0 (documentation), MIT (code) | a9fd1c0 | 2026-11-13 |