Skip to main content

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

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

Allows the mob to drink potions based on specified environment conditions.

Entity Drink Potion Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
potions[]Array of Potions itemsA list of potions that this entity can drink. Each potion entry has the following parameters:
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
speed_modifier0Decimal numberThe movement speed modifier to apply to the entity while it is drinking a potion. A value of 0 represents no change in speed.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity DrinkPotionGoalDefinition PotionData​

Entity DrinkPotionGoalDefinition PotionData Properties​

JSON path: potions

NameDefault ValueTypeDescription
chance1Decimal numberThe percent chance (from 0.0 to 1.0) of this potion being selected when searching for a potion to use.
filters (Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Filters itemThe filters to use when determining if this potion can be selected.
filters (Alternate 1)not setObject
id-1Integer numberThe registry ID of the potion to use
Filters​
Filters Properties​

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

minecraft:behavior.drop_item_for​

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

Allows the entity to move toward a target, and drop an item near the target.

[!Note] Requires the following component in order to work properly:

  • Navigation (minecraft:navigation)

Entity Drop Item For Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
cooldown0.25Decimal numberTotal time that the goal is on cooldown before it can be used again.
drop_item_chance1Decimal numberThe percent chance the entity will drop an item when using this goal. Value must be <= 1.
entity_types[]Array of objectsThe list of conditions another entity must meet to be a valid target to drop an item for.
entity_types (Entity Types)not setEntity Types (Entity Types) item
goal_radius0.5Decimal numberDistance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot. Value must be > 0.
loot_tableStringThe loot table that contains the possible loot the entity can drop with this goal.
max_head_look_at_height10Decimal numberThe maximum height the entities head will look at when dropping the item. The entity will always be looking at its target.
minimum_teleport_distance2Decimal numberIf the target position is farther away than this distance on any tick, the entity will teleport to the target position.
offering_distance1Decimal numberThe preferred distance the entity tries to be from the target it is dropping an item for.
on_drop_attempt{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Drop Attempt itemThe event to trigger when the entity attempts to drop an item.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
search_count0Integer numberThe number of randomly selected blocks each tick that the mob will check within its search range and height for a valid block to move to.
search_height1Integer numberThe height in blocks the entity will search within to find a valid target position. Value must be > 0.
search_range0Integer numberThe distance in blocks the entity will search within to find a valid target position. Value must be > 0.
seconds_before_pickup0Decimal numberThe numbers of seconds that will pass before the dropped entity can be picked up from the ground.
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this goal.
target_range[1, 1, 1]Array of numbersThe range in blocks within which the entity searches to find a target to drop an item for.
target_range (Target Range)not setTarget Range (Target Range) item
teleport_offset[0, 1, 0]Array of numbersWhen the entity teleports, offset the teleport position by this many blocks in the X, Y, and Z coordinate.
teleport_offset (Teleport Offset)not setTeleport Offset (Teleport Offset) item
time_of_day_range{"max":1,"min":0}Time Of Day Range itemThe valid times of day that this goal can be used. For reference: noon is 0.0, sunset is 0.25, midnight is 0.5, and sunrise is 0.75, and back to noon for 1.0.

search_count​

The number of randomly selected blocks each tick that the mob will check within its search range and height for a valid block to move to. A value of 0 will have the mob check every block within range in one tick.

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.

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_drop_attempt

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

Target Range (Target Range)​

Target Range Properties​

JSON path: target_range

NameDefault ValueTypeDescription
x0Decimal number
y0Decimal number
z0Decimal number

Teleport Offset (Teleport Offset)​

Same structure as Target Range (Target Range).

Legacy FloatRange​

Legacy FloatRange Properties​

JSON path: time_of_day_range

NameDefault ValueTypeDescription
max0Decimal number
min0Decimal number

Samples​

minecraft:behavior.eat_block​

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

Allows the entity to consume a block, replace the eaten block with another block, and trigger an event as a result.

Entity Eat Block Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
eat_and_replace_block_pairs[[object Object], [object Object], [object Object]]Array of Eat And Replace Block Pairs itemsA collection of pairs of blocks; the first ("eat_block") is the block the entity should eat, the second ("replace_block") is the block that should replace the eaten block.Sheep: [{"eat_block":"grass","replace_block":"dirt"},{"eat_block":"tallgrass","replace_block":"air"},{"eat_block":"short_dry_grass","replace_block":"air"},{"eat_block":"tall_dry_grass","replace_block":"air"}]
on_eat{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Eat itemThe event to trigger when the block eating animation has completed.Sheep: {"event":"minecraft:on_eat_block","target":"self"}
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Sheep: 6
success_chance0.019999999552965164Keyed set of stringsA molang expression defining the success chance the entity has to consume a block.Sheep: "query.is_baby ? 0.02 : 0.001"
success_chance (as Named set of objects)not setKey/item pairs of Success Chance (Legacy Molang Expression) items
success_chance (as Decimal number)not setDecimal number
time_until_eat1.7999999523162842Decimal numberThe amount of time (in seconds) it takes for the block to be eaten upon a successful eat attempt.Sheep: 1.8

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity EatAndReplaceBlockPair​

Entity EatAndReplaceBlockPair Properties​

JSON path: eat_and_replace_block_pairs

NameDefault ValueTypeDescription
eat_blockStringThe block the entity should eat.
replace_blockStringThe block that should replace the eaten block.

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_eat

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

Legacy Molang Expression​

Legacy Molang Expression Properties​

JSON path: success_chance

NameDefault ValueTypeDescription
expressionnot setString
versionnot setInteger number

Samples​

Sheep​
"minecraft:behavior.eat_block": {
"priority": 6,
"success_chance": "query.is_baby ? 0.02 : 0.001",
"time_until_eat": 1.8,
"eat_and_replace_block_pairs": [
{
"eat_block": "grass",
"replace_block": "dirt"
},
{
"eat_block": "tallgrass",
"replace_block": "air"
},
{
"eat_block": "short_dry_grass",
"replace_block": "air"
},
{
"eat_block": "tall_dry_grass",
"replace_block": "air"
}
],
"on_eat": {
"event": "minecraft:on_eat_block",
"target": "self"
}
}

minecraft:behavior.eat_carried_item​

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

If the mob is carrying a food item, the mob will eat it and the effects will be applied to the mob.

[!Note] Requires food items to be in the entity's inventory in order to eat the food.

Entity Eat Carried Item Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
delay_before_eating0Decimal numberTime in seconds the mob should wait before eating the item.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.eat_mob​

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

Allows the entity to eat a specified Mob.

Entity Eat Mob Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
eat_animation_time1Decimal numberSets the time in seconds the eat animation should play for.Frog: 0.3
eat_mob_soundStringSets the sound that should play when eating a mob.Frog: "tongue"
loot_tableStringThe loot table for loot to be dropped when eating a mob.Frog: "loot_tables/entities/frog.json"
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Frog: 7
pull_in_force1Decimal numberSets the force which the mob-to-be-eaten is pulled towards the eating mob.Frog: 0.75
reach_mob_distance1Decimal numberSets the desired distance to be reached before eating the mob.Frog: 1.75
run_speed1Decimal numberSets the entity's speed when running toward the target.Frog: 2

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Frog​
"minecraft:behavior.eat_mob": {
"run_speed": 2,
"eat_animation_time": 0.3,
"pull_in_force": 0.75,
"reach_mob_distance": 1.75,
"eat_mob_sound": "tongue",
"loot_table": "loot_tables/entities/frog.json",
"priority": 7
}

minecraft:behavior.emerge​

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

Allows this entity to emerge from the ground.

Entity Emerge Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
cooldown_time0.5Decimal numberTime in seconds the mob has to wait before using the goal again
duration5Decimal numberGoal duration in secondsWarden: 7
on_done{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Done itemTrigger to be executed when the goal execution is about to endWarden: {"event":"minecraft:emerged","target":"self"}
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.

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_done

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_done > 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​

Warden​
"minecraft:behavior.emerge": {
"duration": 7,
"on_done": {
"event": "minecraft:emerged",
"target": "self"
}
}

minecraft:behavior.enderman_leave_block​

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

Allows the enderman to drop a block they are carrying.

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

  • Enderman (minecraft:enderman)

Enderman Leave Block Behavior Properties​

NameDefault ValueTypeDescription
prioritynot setInteger numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.

minecraft:behavior.enderman_take_block​

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

Allows the enderman to take a block and carry it around.

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

  • Enderman (minecraft:enderman)

Enderman Take Block Behavior Properties​

NameDefault ValueTypeDescription
prioritynot setInteger numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13