Skip to main content

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

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

Fires an event when this behavior starts, then waits for a duration before stopping. When stopping due to that timeout or due to being interrupted by another behavior, fires another event. query.timer_flag_1 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise.

[!Note] In 1.26.0 the schema is stricter and rejects invalid JSON. cooldown_range and duration_range now only accept an object with min and max values; the previous single-number shorthand is no longer accepted in 1.26.0 and newer.

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

Entity Timer Flag 1 Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choicesSniffer: ["move","look"]
cooldown_range (Legacy FloatRange){"max":0,"min":0}Cooldown Range itemGoal cooldown range in seconds. Can be a range object or a single number.Sniffer: {"min":400,"max":500}
cooldown_range (as Decimal number)not setDecimal number
duration_range (Legacy FloatRange){"max":0,"min":0}Duration Range itemGoal duration range in seconds. Can be a range object or a single number.Sniffer: {"min":2,"max":2}
duration_range (as Decimal number)not setDecimal number
on_end{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}End itemEvent(s) to run when the goal ends.Sniffer: {"event":"on_scenting_success","target":"self"}
on_start{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Start itemEvent(s) to run when the goal starts.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Sniffer: 6

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_end

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

Sniffer​
"minecraft:behavior.timer_flag_1": {
"priority": 6,
"control_flags": [
"move",
"look"
],
"cooldown_range": {
"min": 400,
"max": 500
},
"duration_range": {
"min": 2,
"max": 2
},
"on_end": {
"event": "on_scenting_success",
"target": "self"
}
}

minecraft:behavior.timer_flag_2​

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

Fires an event when this behavior starts, then waits for a duration before stopping. When stopping due to that timeout or due to being interrupted by another behavior, fires another event. query.timer_flag_2 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise.

[!Note] In 1.26.0 the schema is stricter and rejects invalid JSON. cooldown_range and duration_range now only accept an object with min and max values; the previous single-number shorthand is no longer accepted in 1.26.0 and newer.

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

Entity Timer Flag 2 Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choicesSniffer: ["move"]
cooldown_range (Legacy FloatRange){"max":0,"min":0}Cooldown Range itemGoal cooldown range in seconds. Can be a range object or a single number.Sniffer: {"min":0,"max":0}
cooldown_range (as Decimal number)not setDecimal number
duration_range (Legacy FloatRange){"max":0,"min":0}Duration Range itemGoal duration range in seconds. Can be a range object or a single number.Sniffer: {"min":2,"max":5}
duration_range (as Decimal number)not setDecimal number
on_end{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}End itemEvent(s) to run when the goal ends.Sniffer: {"event":"on_rising_end","target":"self"}
on_start{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Start itemEvent(s) to run when the goal starts.
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Sniffer: 2

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_end

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

Sniffer​
"minecraft:behavior.timer_flag_2": {
"priority": 2,
"control_flags": [
"move"
],
"cooldown_range": {
"min": 0,
"max": 0
},
"duration_range": {
"min": 2,
"max": 5
},
"on_end": {
"event": "on_rising_end",
"target": "self"
}
}

minecraft:behavior.timer_flag_3​

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

Fires an event when this behavior starts, then waits for a duration before stopping. When stopping due to that timeout or due to being interrupted by another behavior, fires another event. query.timer_flag_3 will return 1.0 on both the client and server when this behavior is running, and 0.0 otherwise.

[!Note] In 1.26.0 the schema is stricter and rejects invalid JSON. cooldown_range and duration_range now only accept an object with min and max values; the previous single-number shorthand is no longer accepted in 1.26.0 and newer.

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

Entity Timer Flag 3 Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
control_flags[]Control Flags choices
cooldown_range (Legacy FloatRange){"max":0,"min":0}Cooldown Range itemGoal cooldown range in seconds. Can be a range object or a single number.Sniffer: {"min":0,"max":0}
cooldown_range (as Decimal number)not setDecimal number
duration_range (Legacy FloatRange){"max":0,"min":0}Duration Range itemGoal duration range in seconds. Can be a range object or a single number.Sniffer: {"min":2,"max":5}
duration_range (as Decimal number)not setDecimal number
on_end{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}End itemEvent(s) to run when the goal ends.Sniffer: {"event":"on_feeling_happy_end","target":"self"}
on_start{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Start itemEvent(s) to run when the goal starts.
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

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_end

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

Sniffer​
"minecraft:behavior.timer_flag_3": {
"priority": 5,
"cooldown_range": {
"min": 0,
"max": 0
},
"duration_range": {
"min": 2,
"max": 5
},
"on_end": {
"event": "on_feeling_happy_end",
"target": "self"
}
}

minecraft:behavior.trade_interest​

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

Allows the mob to look at a player that is holding a tradable item.

Entity Trade Interest Behavior Properties​

NameDefault ValueTypeDescription
carried_item_switch_time2Decimal numberThe max time in seconds that the trader will hold an item before attempting to switch for a different item that takes the same trade
control_flags[]Control Flags choices
cooldown2Decimal numberThe time in seconds before the trader can use this goal again
interest_time45Decimal numberThe max time in seconds that the trader will be interested with showing its trade items
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
remove_item_time1Decimal numberThe max time in seconds that the trader will wait when you no longer have items to trade
within_radius0Decimal numberDistance in blocks this mob can be interested by a player holding an item they like

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Samples​

minecraft:behavior.trade_with_player​

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

Allows the player to trade with this mob. When the goal starts, it will stop the mob's navigation.

Trade With Player Behavior Properties​

NameDefault ValueTypeDescription
filtersnot setMinecraft filterConditions that need to be met for the behavior to start.
max_distance_from_player8Decimal numberThe max distance that the mob can be from the player before exiting the goal.
prioritynot setInteger numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.

Samples​

minecraft:behavior.transport_items​

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

A behavior that enables a mob to transport items from and to containers.

Entity Transport Items Behavior Properties​

NameDefault ValueTypeDescription
allow_simultaneous_interactionfalseBoolean true/falseWhen true the mob will wait until a container is not used by other entities before starting to interact with it.
allowed_items[]StringA list of item descriptors that are the only items the mob is allowed to transport.
allowed_items (as Keyed set of strings)not setKeyed set of strings
control_flags[]Control Flags choices
destination_container_types (Destination Container Types)[]Destination Container Types itemA list of block descriptors that should be container types to put items in. Can be simple block identifier strings or objects with name, states, and tags.
destination_container_types (Destination Container Type)not setArray of Destination Container Types (Destination Container Type) items
disallowed_items[]StringA list of item descriptors that are the mob is not allowed to transport. If non-empty "allowed_items" must be empty.
disallowed_items (as Keyed set of strings)not setKeyed set of strings
idle_cooldown20Integer numberWhen the mob cannot find a container in which to get or put items, the goal will stop being active for this amount of time in seconds.
initial_cooldown0Integer numberHow long the mob will wait after spawning or getting the goal added before the goal can start.
interaction_time3Decimal numberThe amount of time in seconds spent interacting with the containers.
max_stack_size64Integer numberThe maximum stack size that the mob will try to take from a container. Value must be >= 1. Value must be <= 64.
max_visited_containers16Integer numberThe maximum number of containers that the mob will try to take/place items from before going on cooldown and starting over.
place_strategyanyPlace Strategy choicesThe strategy to use for placing the transported item.
priority0Integer number
search_distance[64, 32]Array of numbersThe maximum search distance horizontally and vertically at which to find containers for taking or placing items.
search_distance (Search Distance)not setSearch Distance (Search Distance) item
search_strategyrandomSearch Strategy choicesThe strategy to use for finding source or destination containers. The nearest valid container or a random valid container in range.
source_container_types (Source Container Types)[]Source Container Types itemA list of block descriptors that should be container types to take items from. Can be simple block identifier strings or objects with name, states, and tags.
source_container_types (Source Container Type)not setArray of Source Container Types (Source Container Type) items

allowed_items​

A list of item descriptors that are the only items the mob is allowed to transport. If this and "disallowed_items" are both empty, then all items are allowed. If non-empty "disallowed_items" must be empty.

place_strategy​

The strategy to use for placing the transported item. Any - always place if there is room, With matching - place if there is a matching item in the container, With matching or empty - like With matching but will also place in empty containers.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Destination Container Types​

Destination Container Types Properties​

JSON path: destination_container_types

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

Destination Container Types (Destination Container Type)​

Destination Container Type Properties​

JSON path: destination_container_types

NameDefault ValueTypeDescription
namenot setStringBlock identifier like 'minecraft:chest'
statesnot setKeyed set of stringsBlock state values to match
tagsnot setStringBlock tags to match

Place Strategy choices​

ValueTitleDescription
anyAny
with_matchingWith matching
with_matching_or_emptyWith matching or empty

Search Distance (Search Distance)​

Search Distance Properties​

JSON path: search_distance

NameDefault ValueTypeDescription
x0Decimal number
y0Decimal number

Search Strategy choices​

ValueTitleDescription
nearestNearest
randomRandom

Source Container Types​

Same structure as Destination Container Types.

Source Container Types (Source Container Type)​

Same structure as Destination Container Types (Destination Container Type).

Samples​

Sources
idSourceLicenseCommitAccessed
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13