Skip to main content

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​

NameDefault ValueTypeDescription
attack_oncefalseBoolean true/falseAllows the mob to perform this melee attack behavior only once during its lifetime.
attack_typesStringDefines the entity types this entity will attack.
can_spread_on_firefalseBoolean true/falseAllows the mob, if on fire and empty handed, to ignite its target upon a successful attack.
control_flags[]Control Flags choices
cooldown_time1Decimal numberCooldown time, in seconds, between consecutive attacks.
inner_boundary_time_increase0.25Decimal numberTime, in seconds, added to the attack path recalculation interval when the target is beyond "path_inner_boundary".
max_path_time0.550000011920929Decimal numberMaximum base time, in seconds, before recalculating a new attack path to the target (before increases are applied).
melee_fov90Decimal numberField of view, in degrees, used by the hard-coded sensing component to detect a valid attack target.
min_path_time0.20000000298023224Decimal numberMinimum 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 itemDefines 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 itemDefines the event to trigger when this entity kills the target.
outer_boundary_time_increase0.5Decimal numberTime, in seconds, added to the attack path recalculation interval when the target is beyond "path_outer_boundary".
path_fail_time_increase0.75Decimal numberTime, in seconds, added to the attack path recalculation interval when the mob cannot move along the current path.
path_inner_boundary16Decimal numberDistance at which to increase attack path recalculation by "inner_boundary_time_increase".
path_outer_boundary32Decimal numberDistance at which to increase attack path recalculation by "outer_boundary_time_increase".
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
random_stop_interval0Integer numberDefines a 1-in-N chance for the mob to stop its current attack, where N equals "random_stop_interval".
reach_multiplier2Decimal numberUsed with the base size of the entity to determine minimum target-distance before trying to deal attack damage.
require_complete_pathfalseBoolean true/falseSpecifies whether a full navigation path from the mob to the target is required.
speed_multiplier1Decimal numberMultiplier applied to the mob's movement speed when moving toward its target.
track_targetfalseBoolean true/falseAllows the mob to track its target even if it lacks a hard-coded sensing component.
x_max_rotation30Decimal numberMaximum rotation, in degrees, on the X-axis while the mob is trying to look at its target.
y_max_head_rotation30Decimal numberMaximum rotation, in degrees, on the Y-axis while the mob is trying to look at its target.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

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

NameDefault ValueTypeDescription
eventString
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemFilters allow data objects to specify test criteria which allows their use.
filters (Alternate 1)not setObject
targetselfTarget 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

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe value being compared with the test.

Target choices​

ValueTitleDescription
babyBaby
blockBlock
damagerDamager
holderHolder
itemItem
otherOther
parentParent
playerPlayer
selfSelf
targetTarget

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​

NameDefault ValueTypeDescriptionExample Values
attack_oncefalseBoolean true/falseAllows the mob to perform this melee attack behavior only once during its lifetime.
attack_typesStringDefines the entity types this entity will attack.
can_spread_on_firefalseBoolean true/falseAllows the mob, if on fire and empty handed, to ignite its target upon a successful attack.Drowned: true
control_flags[]Control Flags choices
cooldown_time1Decimal numberCooldown time, in seconds, between consecutive attacks.
horizontal_reach0.800000011920929Decimal numberThe 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_increase0.25Decimal numberTime, in seconds, added to the attack path recalculation interval when the target is beyond "path_inner_boundary".
max_path_time0.550000011920929Decimal numberMaximum base time, in seconds, before recalculating a new attack path to the target (before increases are applied).
melee_fov90Decimal numberField of view, in degrees, used by the hard-coded sensing component to detect a valid attack target.
min_path_time0.20000000298023224Decimal numberMinimum 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 itemDefines 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 itemDefines the event to trigger when this entity kills the target.
outer_boundary_time_increase0.5Decimal numberTime, in seconds, added to the attack path recalculation interval when the target is beyond "path_outer_boundary".
path_fail_time_increase0.75Decimal numberTime, in seconds, added to the attack path recalculation interval when the mob cannot move along the current path.
path_inner_boundary16Decimal numberDistance at which to increase attack path recalculation by "inner_boundary_time_increase".
path_outer_boundary32Decimal numberDistance at which to increase attack path recalculation by "outer_boundary_time_increase".
priority0Integer numberAs 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_interval0Integer numberDefines a 1-in-N chance for the mob to stop its current attack, where N equals "random_stop_interval".Cave Spider: 100
require_complete_pathfalseBoolean true/falseSpecifies whether a full navigation path from the mob to the target is required.Drowned: true
speed_multiplier1Decimal numberMultiplier applied to the mob's movement speed when moving toward its target.Bogged: 1.25
track_targetfalseBoolean true/falseAllows the mob to track its target even if it lacks a hard-coded sensing component.Bogged: true
x_max_rotation30Decimal numberMaximum rotation, in degrees, on the X-axis while the mob is trying to look at its target.
y_max_head_rotation30Decimal numberMaximum rotation, in degrees, on the Y-axis while the mob is trying to look at its target.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

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

NameDefault ValueTypeDescription
eventString
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemFilters allow data objects to specify test criteria which allows their use.
filters (Alternate 1)not setObject
targetselfTarget 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

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe value being compared with the test.

Target choices​

ValueTitleDescription
babyBaby
blockBlock
damagerDamager
holderHolder
itemItem
otherOther
parentParent
playerPlayer
selfSelf
targetTarget

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​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
cooldown_time0Decimal numberTime in seconds the mob has to wait before using the goal again
duration1Decimal numberAmount of time in seconds that the entity will chat with another entity
mingle_distance2Decimal numberThe 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_typeStringThe entity type that this entity is allowed to mingle with
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this goal.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

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​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
priority0Integer numberAs 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_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI GoalCave Spider: 1.25, Chicken: 1.5
target_dist0Decimal numberThe distance at which this mob wants to be away from its target
track_targetfalseBoolean true/falseIf true, this mob will chase after the target as long as it's a valid targetCave Spider: true

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

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_range must be specified as a Float Range object (an object with range_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​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
destination_pos_spread_degrees90Decimal numberThis 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 itemThe 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 itemConditions 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 setObject
height_difference_limit10Decimal numberDistance 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_distance5Integer numberHorizontal search distance (in blocks) when searching for a position to move away from target.
movement_speed0.6000000238418579Decimal numberThe speed with which the entity should move to its target position.Breeze: 1.2
priority0Integer numberAs 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_distance5Integer numberVertical 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​

ValueTitleDescription
jumpJump
lookLook
moveMove

Legacy FloatRange​

Legacy FloatRange Properties​

JSON path: destination_position_range

NameDefault ValueTypeDescription
max0Decimal number
min0Decimal number

Filters​

Filters Properties​

JSON path: filters

NameDefault ValueTypeDescription
domainnot setObjectThe domain the test should be performed in.
operatornot setObjectThe comparison to apply with 'value'.
subjectnot setObjectThe subject of this filter test.
testnot setStringThe name of the test to apply.
valuenot setObjectThe 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​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
speed_multiplier0.800000011920929Decimal numberThe movement speed modifier to apply to the entity while it is moving indoors.
timeout_cooldown8Decimal numberThe cooldown time in seconds before the goal can be reused after pathfinding fails

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

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​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
goal_radius2Decimal numberThe radius away from the target block to count as reaching the goal
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
search_count10Integer numberThe amount of times to try finding a random outdoors position before failing
search_height5Integer numberThe y range to search for an outdoors position for
search_range15Integer numberThe x and z range to search for an outdoors position for
speed_multiplier0.5Decimal numberThe movement speed modifier to apply to the entity while it is moving outdoors
timeout_cooldown8Decimal numberThe cooldown time in seconds before the goal can be reused after pathfinding fails

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

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​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
only_at_nightfalseBoolean true/falseIf true, the mob will only move through the village during night timeIron Golem: true
priority0Integer numberAs 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_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI GoalIron Golem: 0.6

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Iron Golem​
"minecraft:behavior.move_through_village": {
"only_at_night": true,
"priority": 3,
"speed_multiplier": 0.6
}
Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13