Skip to main content

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

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

Allows the mob to randomly break surface of the water.

Entity Random Breach Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
cooldown_time0Decimal numberTime in seconds the mob has to wait before using the goal againDolphin: 2
interval120Integer numberA random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goalDolphin: 50
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Dolphin: 6
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI Goal
xz_dist10Integer numberDistance in blocks on ground that the mob will look for a new spot to move to. Must be at least 1Dolphin: 6
y_dist7Integer numberDistance in blocks that the mob will look up or down for a new spot to move to. Must be at least 1

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Dolphin​
"minecraft:behavior.random_breach": {
"priority": 6,
"interval": 50,
"xz_dist": 6,
"cooldown_time": 2
}

minecraft:behavior.random_fly​

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

Allows a mob to randomly fly around.

Entity Random Fly Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
avoid_damage_blocksnot setBoolean true/falseIf true, the mob will avoid blocks that cause damage when flying.Parrot: true
can_land_on_treestrueBoolean true/falseIf true, the mob can stop flying and land on a tree instead of the groundParrot: true
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.Parrot: 3
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI GoalParrot: 1
xz_dist10Integer numberDistance in blocks on ground that the mob will look for a new spot to move to. Must be at least 1Parrot: 15
y_dist7Integer numberDistance in blocks that the mob will look up or down for a new spot to move to. Must be at least 1Parrot: 1
y_offsetnot setDecimal number

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Parrot​
"minecraft:behavior.random_fly": {
"priority": 3,
"avoid_damage_blocks": true,
"can_land_on_trees": true,
"y_offset": 0,
"speed_multiplier": 1,
"xz_dist": 15,
"y_dist": 1
}

minecraft:behavior.random_hover​

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

Allows the mob to hover around randomly, close to the surface.

[!Note] In format version 1.26.20, hover_height must be specified as a Float Range object (an object with range_min / range_max). Legacy scalar or array forms no longer parse.

Entity Random Hover Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
hover_height{"max":0,"min":0}Hover Height itemThe height above the surface which the mob will try to maintainAllay: [1,4]
interval120Integer numberA random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goalAllay: 1
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Allay: 9
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI Goal
xz_dist10Integer numberDistance in blocks on ground that the mob will look for a new spot to move to. Must be at least 1Allay: 8
y_dist7Integer numberDistance in blocks that the mob will look up or down for a new spot to move to. Must be at least 1Allay: 8
y_offset0Decimal numberHeight in blocks to add to the selected target positionAllay: -1

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Block IntRange​

Block IntRange Properties​

JSON path: hover_height

NameDefault ValueTypeDescription
max0Integer number
min0Integer number

Samples​

Allay​
"minecraft:behavior.random_hover": {
"hover_height": [
1,
4
],
"y_dist": 8,
"interval": 1,
"xz_dist": 8,
"priority": 9,
"y_offset": -1
}

minecraft:behavior.random_look_around​

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

Allows the mob to randomly look around.

Entity Random Look Around Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
look_time{"max":40,"min":20}Look Time itemThe range of time in seconds the mob will stay looking in a random direction before looking elsewhere
max_angle_of_view_horizontal180Decimal numberThe rightmost angle a mob can look at on the horizontal plane with respect to its initial facing direction.
min_angle_of_view_horizontal-180Decimal numberThe leftmost angle a mob can look at on the horizontal plane with respect to its initial facing direction.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Allay: 8, Blaze: 5, Cave Spider: 7
probability0.019999999552965164Decimal numberThe probability of randomly looking around.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Block IntRange​

Block IntRange Properties​

JSON path: look_time

NameDefault ValueTypeDescription
max0Integer number
min0Integer number

Samples​

Allay​
"minecraft:behavior.random_look_around": {
"priority": 8
}
Blaze​
"minecraft:behavior.random_look_around": {
"priority": 5
}
Cave Spider​
"minecraft:behavior.random_look_around": {
"priority": 7
}

minecraft:behavior.random_look_around_and_sit​

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

Allows the mob to randomly sit and look around for a duration. Note: Must have a sitting animation set up to use this.

Entity Random Look Around And Sit Behavior Properties​

NameDefault ValueTypeDescription
continue_if_leashedfalseBoolean true/falseIf the goal should continue to be used as long as the mob is leashed.
continue_sitting_on_reloadfalseBoolean true/falseThe mob will stay sitting on reload.
control_flags[]Control Flags choices
max_angle_of_view_horizontal180Decimal numberThe rightmost angle a mob can look at on the horizontal plane with respect to its initial facing direction.
max_look_count2Integer numberThe max amount of unique looks a mob will have while looking around.
max_look_time40Integer numberThe max amount of time (in ticks) a mob will stay looking at a direction while looking around.
min_angle_of_view_horizontal-180Decimal numberThe leftmost angle a mob can look at on the horizontal plane with respect to its initial facing direction.
min_look_count1Integer numberThe min amount of unique looks a mob will have while looking around.
min_look_time20Integer numberThe min amount of time (in ticks) a mob will stay looking at a direction while looking around.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
probability0.019999999552965164Decimal numberThe probability of randomly looking around.
random_look_around_cooldown0Integer numberThe cooldown in seconds before the goal can be used again.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.random_search_and_dig​

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

Allows this entity to locate a random target block that it can path find to. Once found, the entity will move towards it and dig up an item. [Default target block types: Dirt, Grass, Podzol, DirtWithRoots, MossBlock, Mud, MuddyMangroveRoots].

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

Entity Random Search And Dig Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
cooldown_range{"max":0,"min":0}Cooldown Range itemGoal cooldown range in seconds.Sniffer: {"min":0,"max":0}
digging_duration_range{"max":10,"min":8}Digging Duration Range itemDigging duration in seconds.Sniffer: {"min":8,"max":10}
find_valid_position_retries5Integer numberAmount of retries to find a valid target position within search range.Sniffer: 5
goal_radius1.5Decimal numberDistance in blocks within the entity to considers it has reached it's target position.Sniffer: 2
item_tableStringFile path relative to the resource pack root for items to spawn list (loot table format).Sniffer: "loot_tables/gameplay/entities/sniffer_seeds.json"
on_digging_start{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Digging Start itemEvent to run when the goal ends searching has begins digging.Sniffer: {"event":"on_digging_start","target":"self"}
on_fail_during_digging{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Fail During Digging itemEvent to run when the goal failed while in digging state.Sniffer: {"event":"on_fail_during_digging","target":"self"}
on_fail_during_searching{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Fail During Searching itemEvent to run when the goal failed while in searching state.Sniffer: {"event":"on_fail_during_searching","target":"self"}
on_item_found{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Item Found itemEvent to run when the goal find a item.Sniffer: {"event":"on_item_found","target":"self"}
on_searching_start{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Searching Start itemEvent to run when the goal starts searching.Sniffer: {"event":"on_searching_start","target":"self"}
on_success{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Success itemEvent to run when searching and digging has ended.Sniffer: {"event":"on_search_and_digging_success","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.Sniffer: 5
search_range_xz10Integer numberWidth and length of the volume around the entity used to find a valid target positionSniffer: 20
search_range_y7Integer numberHeight of the volume around the entity used to find a valid target positionSniffer: 3
spawn_item_after_seconds0Decimal numberDigging duration before spawning item in seconds.Sniffer: 6
spawn_item_pos_offset0Decimal numberDistance to offset the item's spawn location in the direction the mob is facing.Sniffer: 2.25
speed_multiplier1Decimal numberSearching movement speed multiplier.Sniffer: 1.25
target_blocks (Target Blocks)[]Array of Target Blocks itemsList of target block types the goal will look to dig on. Overrides the default list.Sniffer: ["minecraft:dirt","minecraft:coarse_dirt","minecraft:grass","minecraft:podzol","minecraft:dirt_with_roots","minecraft:moss_block","minecraft:pale_moss_block","minecraft:mud","minecraft:muddy_mangrove_roots"]
target_blocks (as String)not setString
target_blocks (as Object)not setObject
target_dig_position_offset2.25Decimal numberDig target position offset from the feet position of the mob in their facing direction.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Legacy FloatRange​

Legacy FloatRange Properties​

JSON path: cooldown_range

NameDefault ValueTypeDescription
max0Decimal number
min0Decimal number

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_digging_start

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

Target Blocks​

Target Blocks Properties​

JSON path: target_blocks

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

Samples​

Sniffer​
"minecraft:behavior.random_search_and_dig": {
"priority": 5,
"speed_multiplier": 1.25,
"find_valid_position_retries": 5,
"target_blocks": [
"minecraft:dirt",
"minecraft:coarse_dirt",
"minecraft:grass",
"minecraft:podzol",
"minecraft:dirt_with_roots",
"minecraft:moss_block",
"minecraft:pale_moss_block",
"minecraft:mud",
"minecraft:muddy_mangrove_roots"
],
"goal_radius": 2,
"search_range_xz": 20,
"search_range_y": 3,
"cooldown_range": {
"min": 0,
"max": 0
},
"digging_duration_range": {
"min": 8,
"max": 10
},
"item_table": "loot_tables/gameplay/entities/sniffer_seeds.json",
"spawn_item_after_seconds": 6,
"spawn_item_pos_offset": 2.25,
"on_searching_start": {
"event": "on_searching_start",
"target": "self"
},
"on_fail_during_searching": {
"event": "on_fail_during_searching",
"target": "self"
},
"on_digging_start": {
"event": "on_digging_start",
"target": "self"
},
"on_item_found": {
"event": "on_item_found",
"target": "self"
},
"on_fail_during_digging": {
"event": "on_fail_during_digging",
"target": "self"
},
"on_success": {
"event": "on_search_and_digging_success",
"target": "self"
}
}

minecraft:behavior.random_sitting​

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

Allows the mob to randomly sit for a duration.

Entity Random Sitting Behavior Properties​

NameDefault ValueTypeDescription
control_flags[]Control Flags choices
cooldown100Decimal numberTime in seconds the mob has to wait before using the goal again
cooldown_time0Decimal numberTime in seconds the mob has to wait before using the goal again
min_sit_time10Decimal numberThe minimum amount of time in seconds before the mob will stand back up
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
start_chance0.10000000149011612Decimal numberThis is the chance that the mob will start this goal, from 0 to 1
stop_chance0.30000001192092896Decimal numberThis is the chance that the mob will stop this goal, from 0 to 1

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

minecraft:behavior.random_stroll​

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

Allows a mob to randomly stroll around.

Entity Random Stroll Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
interval120Integer numberA random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goal
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Blaze: 4, Bogged: 6
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI GoalBlaze: 1, Cave Spider: 0.8
xz_dist10Integer numberDistance in blocks on ground that the mob will look for a new spot to move to. Must be at least 1
y_dist7Integer numberDistance in blocks that the mob will look up or down for a new spot to move to. Must be at least 1

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Blaze​
"minecraft:behavior.random_stroll": {
"priority": 4,
"speed_multiplier": 1
}
Bogged​
"minecraft:behavior.random_stroll": {
"priority": 6,
"speed_multiplier": 1
}
Cave Spider​
"minecraft:behavior.random_stroll": {
"priority": 6,
"speed_multiplier": 0.8
}

minecraft:behavior.random_swim​

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

Allows an entity to randomly move through water.

Entity Random Swim Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
avoid_surfacetrueBoolean true/falseIf true, the mob will avoid surface water blocks by swimming below them
control_flags[]Control Flags choices
interval120Integer numberA random value to determine when to randomly move somewhere. This has a 1/interval chance to choose this goalGuardian: 80
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Dolphin: 5, Elder Guardian: 7
speed_multiplier1Decimal numberMovement speed multiplier of the mob when using this AI GoalElder Guardian: 0.5, Guardian: 1
xz_dist10Integer numberDistance in blocks on ground that the mob will look for a new spot to move to. Must be at least 1Dolphin: 20
y_dist7Integer numberDistance in blocks that the mob will look up or down for a new spot to move to. Must be at least 1

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

Dolphin​
"minecraft:behavior.random_swim": {
"priority": 5,
"interval": 0,
"xz_dist": 20
}
Elder Guardian​
"minecraft:behavior.random_swim": {
"avoid_surface": false,
"speed_multiplier": 0.5,
"priority": 7
}
Guardian​
"minecraft:behavior.random_swim": {
"avoid_surface": false,
"speed_multiplier": 1,
"interval": 80,
"priority": 7
}
Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13