Skip to main content

Entity AI goal reference (37/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.swell​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_swell.md)

Allows the creeper to swell up when a player is nearby. It can only be used by Creepers.

Entity Swell 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.
start_distance10Decimal numberThis mob starts swelling when a target is at least this many blocks away.
stop_distance2Decimal numberThis mob stops swelling when a target has moved away at least this many blocks.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.swim_idle​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_swim_idle.md)

Allows the entity go idle, if swimming. Entity must be in water.

Entity Swim Idle Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
idle_time5Decimal numberAmount of time (in seconds) to stay idle.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
success_rate0.10000000149011612Decimal numberPercent chance this entity will go idle, 1.0 = 100%.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.swim_up_for_breath​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_swim_up_for_breath.md)

Allows the mob to try to move to air once it is close to running out of its total breathable supply. Requires "minecraft:breathable".

[!Note] This item requires a format version of at least 1.21.20.

Entity Swim Up For Breath Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
material_typewaterStringThe material the mob is traveling in. An air block will only be considered valid to move to with a block of this material below it. Options are: "water", "lava", or "any".
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Dolphin: 1
search_height16Integer numberThe height (in blocks) above the mob's current position that it will search for a valid air block to move to.
search_radius4Integer numberThe radius (in blocks) around the mob's current position that it will search for a valid air block to move to.
speed_mod1.399999976158142Decimal numberMovement speed multiplier of the mob when using this goal.

search_height​

The height (in blocks) above the mob's current position that it will search for a valid air block to move to. If a valid block cannot be found, the mob will move to the position this many blocks above it.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Dolphin​
"minecraft:behavior.swim_up_for_breath": {
"priority": 1
}

minecraft:behavior.swim_wander​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_swim_wander.md)

Allows the entity to wander around while swimming, when not path-finding.

Entity Swim Wander Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
interval0.008329999633133411Decimal numberPercent chance to start wandering, when not path-finding. 1 = 100%
look_ahead5Decimal numberDistance to look ahead for obstacle avoidance, while wandering.
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 numberThis multiplier modifies the entity's speed when wandering.
wander_time5Decimal numberAmount of time (in seconds) to wander after wandering behavior was successfully started.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.swim_with_entity​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_swim_with_entity.md)

Allows the entity follow another entity. Both entities must be swimming [ie, in water].

Swim With Entity Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
catch_up_multiplier2.5Decimal numberThe multiplier this entity's speed is modified by when matching another entity's direction.Dolphin: 2.5
catch_up_threshold12Decimal numberDistance, from the entity being followed, at which this entity will speed up to reach that entity.Dolphin: 12
chance_to_stop0.0333Decimal numberPercent chance to stop following the current entity, if they're riding another entity or they're not swimming. 1.0 = 100%Dolphin: 0.0333
entity_typesnot setArray of stringsFilters which types of entities are valid to follow.Dolphin: [{"filters":{"test":"is_family","subject":"other","value":"player"}}]
match_direction_threshold2Decimal numberDistance, from the entity being followed, at which this entity will try to match that entity's directionDolphin: 2
prioritynot setInteger numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Dolphin: 4
search_range20Decimal numberRadius around this entity to search for another entity to follow.Dolphin: 20
speed_multiplier1.5Decimal numberThe multiplier this entity's speed is modified by when trying to catch up to the entity being followed.Dolphin: 1.5
state_check_interval0.5Decimal numberTime (in seconds) between checks to determine if this entity should catch up to the entity being followed or match the direction of the entity being followed.Dolphin: 0.5
stop_distance5Decimal numberDistance, from the entity being followed, at which this entity will stop following that entity.Dolphin: 5
success_rate0.1Decimal numberPercent chance to start following another entity, if not already doing so. 1.0 = 100%Dolphin: 0.1

Samples​

Dolphin​
"minecraft:behavior.swim_with_entity": {
"priority": 4,
"success_rate": 0.1,
"chance_to_stop": 0.0333,
"state_check_interval": 0.5,
"catch_up_threshold": 12,
"match_direction_threshold": 2,
"catch_up_multiplier": 2.5,
"speed_multiplier": 1.5,
"search_range": 20,
"stop_distance": 5,
"entity_types": [
{
"filters": {
"test": "is_family",
"subject": "other",
"value": "player"
}
}
]
}

minecraft:behavior.swoop_attack​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_swoop_attack.md)

Allows an entity to attack using swoop attack behavior; Ideal for use with flying mobs. The behavior ends if the entity has a horizontal collision or gets hit.

Entity Swoop Attack Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
damage_reach0.20000000298023224Decimal numberAdded to the base size of the entity, to determine the target's maximum allowable distance, when trying to deal attack damage.
delay_range{"max":20,"min":10}Delay Range itemMinimum and maximum cooldown time-range (in seconds) between each attempted swoop attack.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Phantom: 2
speed_multiplier1Decimal numberDuring swoop attack behavior, this determines the multiplier the entity's speed is modified by when moving toward the target.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Legacy FloatRange​

Legacy FloatRange Properties​

JSON path: delay_range

NameDefault ValueTypeDescription
max0Decimal number
min0Decimal number

Samples​

Phantom​
"minecraft:behavior.swoop_attack": {
"priority": 2
}

minecraft:behavior.take_block​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_take_block.md)

AI goal that makes entities pick up blocks from the world, like Endermen grabbing blocks to carry. Configure which blocks the entity can take and the search radius. Works with place_block behavior to create entities that relocate blocks or harvest materials from the environment.

[!Note] This item requires a format version of at least 1.21.100.

Entity Take Block Behavior Properties​

NameDefault ValueTypeDescription
affected_by_griefing_ruletrueBoolean true/falseIf true, whether the goal is affected by the mob griefing game rule.
blocks (Blocks)[]Array of Blocks itemsBlock descriptors for which blocks are valid to be taken by the entity, if empty all blocks are valid.
blocks (as String)not setString
blocks (as Object)not setObject
can_take (Can Take){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Can Take itemFilters for if the entity should try to take a block. Self and Target are set.
can_take (Alternate 1)not setObject
chance1Decimal numberChance each tick for the entity to try and take a block. Value must be <= 1.
control_flags[]Control Flags choices
on_take{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Take itemTrigger ran if the entity does take a block. Self, Target, and Block are set.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
requires_line_of_sighttrueBoolean true/falseIf true, whether the entity needs line of sight to the block they are trying to take.
xz_range{"max":2,"min":-2}Xz Range itemXZ range from which the entity will try and take blocks from.
y_range{"max":3,"min":0}y Range itemY range from which the entity will try and take blocks from.

Blocks​

Blocks Properties​

JSON path: blocks

NameDefault ValueTypeDescription
nameString
states{}Integer number
states (as String)not setString
states (as Boolean true/false)not setBoolean true/false
tagsString

Can Take​

Can Take Properties​

JSON path: can_take

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.

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_take

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_take > 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

Block IntRange​

Block IntRange Properties​

JSON path: xz_range

NameDefault ValueTypeDescription
max0Integer number
min0Integer number

Samples​

minecraft:behavior.take_flower​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_take_flower.md)

Allows the mob to accept flowers from another mob with the minecraft:offer_flower behavior.

[!Note] Can only be used on the following type of entity:

  • Villager (minecraft:villager)

Entity Take Flower Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
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.
filters (Alternate 1)not setObject
max_head_rotation_y30Decimal numberMaximum rotation (in degrees), on the Y-axis, this entity can rotate its head while trying to look at the target. Value must be > 0.
max_rotation_x30Decimal numberMaximum rotation (in degrees), on the X-axis, this entity can rotate while trying to look at the target. Value must be > 0.
max_wait_time20Decimal numberThe maximum amount of time (in seconds) for the mob to randomly wait for before taking the flower.
min_distance_to_target2Decimal numberMinimum distance (in blocks) for the entity to be considered having reached its target. Value must be > 0.
min_wait_time4Decimal numberThe minimum amount of time (in seconds) for the mob to randomly wait for before taking the flower.
on_take_flower{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Take Flower itemEvent triggered when the entity takes a flower from another entity.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
search_area[6, 2, 6]Array of numbersThe dimensions of the AABB used to search for a potential mob to take a flower from.
search_area (Search Area)not setSearch Area (Search Area) item
speed_multiplier0.5Decimal numberMovement speed multiplier of the mob when using this AI Goal

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

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.

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_take_flower

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.

Target choices​

ValueTitleDescription
babyBaby
blockBlock
damagerDamager
holderHolder
itemItem
otherOther
parentParent
playerPlayer
selfSelf
targetTarget

Search Area (Search Area)​

Search Area Properties​

JSON path: search_area

NameDefault ValueTypeDescription
x0Decimal number
y0Decimal number
z0Decimal number

Samples​

minecraft:behavior.target_when_pushed​

(Source: ms-learn, creator/Reference/Content/EntityReference/Examples/EntityGoals/minecraftBehavior_target_when_pushed.md)

Allows the mob to target another mob when it is pushed by that mob.

Entity Target When Pushed Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
entity_types[]Array of objectsList of entity types that can trigger this mob to begin targetingIron Golem: [{"filters":{"all_of":[{"subject":"other","test":"is_family","value":"monster"},{"operator":"not","test":"is_family","subject":"other","value":"creeper"}]}}]
entity_types (Entity Types)not setEntity Types (Entity Types) item
percent_chance0Decimal numberThe probability that the mob will target another mob when pushed. A value of 100 is 100%Iron Golem: 5
priority0Integer numberIron Golem: 1

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity Types (Entity Types)​

Entity Types Properties​

JSON path: entity_types

NameDefault ValueTypeDescription
check_if_outnumberedfalseBoolean true/falseIf true, the mob will check if its outnumbered
cooldown0Integer numberThe amount of time in seconds that the mob has to wait before selecting a target of the same type again
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemConditions that make this entry in the list valid
filters (Alternate 1)not setObject
max_dist16Decimal numberMaximum distance this mob can be away to be a valid choice
max_flee10Decimal numberMaximum distance this mob can be from the target to stop fleeing
max_height-1Decimal numberMaximum height this mob can be away to be a valid choice
must_seenot setBoolean true/falseIf true, the mob has to be visible to be a valid choice
must_see_forget_duration3Integer numberDetermines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more
priority0Integer numberPriority for this mob type
reevaluate_descriptionfalseBoolean true/falseIf true, the mob will stop being targeted if it stops meeting any conditions.
sprint_speed_multiplier1Decimal numberMultiplier for the sprinting speed. A value of 1.0 means the speed is unchanged
walk_speed_multiplier1Decimal numberMultiplier for the walking speed. A value of 1.0 means the speed is unchanged
Filters​
Filters Properties​

JSON path: entity_types > 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​

Iron Golem​
"minecraft:behavior.target_when_pushed": {
"entity_types": [
{
"filters": {
"all_of": [
{
"subject": "other",
"test": "is_family",
"value": "monster"
},
{
"operator": "not",
"test": "is_family",
"subject": "other",
"value": "creeper"
}
]
}
}
],
"percent_chance": 5,
"priority": 1
}
Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13