Skip to main content

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

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

Allows mobs to occassionally stop and take a nap under certain conditions.

Entity Nap Behavior Properties​

NameDefault ValueTypeDescription
can_nap_filters (Can Nap Filters){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Can Nap Filters itemConditions that need to be met for the entity to nap.
can_nap_filters (as Object)not setObject
control_flags[]Control Flags choices
cooldown_max0Decimal numberMaximum time in seconds the mob has to wait before using the goal again
cooldown_min0Decimal numberMinimum time in seconds the mob has to wait before using the goal again
mob_detect_dist6Decimal numberThe block distance in x and z that will be checked for mobs that this mob detects
mob_detect_height6Decimal numberThe block distance in y that will be checked for mobs that this mob detects
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.
wake_mob_exceptions (Wake Mob Exceptions){"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Wake Mob Exceptions itemFilters for mobs that will not wake this entity from napping.
wake_mob_exceptions (as Object)not setObject

Can Nap Filters​

Can Nap Filters Properties​

JSON path: can_nap_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.

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Wake Mob Exceptions​

Same structure as Can Nap Filters.

Samples​

minecraft:behavior.nearest_attackable_target​

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

Allows an entity to attack the closest target within a given subset of specific target types.

Entity Nearest Attackable Target Behavior Properties​

NameDefault ValueTypeDescriptionExample Values
attack_interval (Legacy FloatRange){"max":0,"min":0}Attack Interval itemTime range (in seconds) between searching for an attack target, range is in (0, "attack_interval"].Cave Spider: {"min":10,"max":10}, {"min":5,"max":5}
attack_interval (as Integer number)not setInteger number
attack_interval\attack_interval_minnot setString|
attack_ownerfalseBoolean true/falseIf true, this entity can attack its owner.
control_flags[]Control Flags choices
entity_types[]Array of Entity Types itemsList of entity types that this mob considers valid targetsBlaze: [{"filters":{"AND":[{"test":"is_family","subject":1,"operator":0,"value":"player"}]},"max_dist":48}], Bogged: [{"filters":{"test":"is_family","subject":"other","value":"player"}},{"filters":{"test":"is_family","subject":"other","value":"irongolem"}},{"filters":{"all_of":[{"test":"is_family","subject":"other","value":"baby_turtle"},{"test":"in_water","subject":"other","operator":"!=","value":true}]}}], Breeze: [{"filters":{"AND":[{"test":"is_family","subject":1,"operator":0,"value":"player"}]},"max_dist":24},{"filters":{"AND":[{"test":"is_family","subject":1,"operator":0,"value":"irongolem"}]},"max_dist":24}]
entity_types (Entity Types)not setEntity Types (Entity Types) item
must_reachfalseBoolean true/falseIf true, this entity requires a path to the target.
must_seefalseBoolean true/falseDetermines if target-validity requires this entity to be in range only, or both in range and in sight.Blaze: true
must_see_forget_duration3Decimal numberTime (in seconds) the target must not be seen by this entity to become invalid. Used only if "must_see" is true.Drowned: 17
persist_time0Decimal numberTime (in seconds) this entity can continue attacking the target after the target is no longer valid.Drowned: 0.5
priority0Integer numberAs priority approaches 0, the priority is increased. The higher the priority, the sooner this behavior will be executed as a goal.Blaze: 2, Breeze: 1
reselect_targetsfalseBoolean true/falseAllows the attacking entity to update the nearest target, otherwise a target is only reselected after each "scan_interval" or "attack_interval".Bogged: true
scan_interval10Integer numberIf "attack_interval" is 0 or isn't declared, then between attacks: scanning for a new target occurs every amount of ticks equal to "scan_interval", minimum value is 1.
set_persistentfalseBoolean true/falseAllows the actor to be set to persist upon targeting a player
target_acquisition_probability1Decimal numberProbability (0-1) that the goal will succeed when a candidate target passes all filters.
target_invisible_multiplier0.699999988079071Decimal numberMultiplied with the target's armor coverage percentage to modify "max_dist" when detecting an invisible target.
target_search_height-1Decimal numberMaximum vertical target-search distance, if it's greater than the target type's "max_dist". A negative value defaults to "entity_types" greatest "max_dist". Value must be >= -1.
target_sneak_visibility_multiplier0.800000011920929Decimal numberMultiplied with the target type's "max_dist" when trying to detect a sneaking target.
within_radius0Decimal numberMaximum distance this entity can be from the target when following it, otherwise the target becomes invalid. This value is only used if the entity doesn't declare "minecraft:follow_range".Breeze: 24, Drowned: 12

attack_interval​

Time range (in seconds) between searching for an attack target, range is in (0, "attack_interval"]. Only used if "attack_interval" is greater than 0, otherwise "scan_interval" is used. From 1.21.130, attack_interval accepts an [int, int] range to randomize the time between target searches. A single integer remains supported and is treated as a fixed interval. In 1.26.0 the schema is stricter and attack_interval only accepts an object with min and max values; the single-number shorthand is no longer accepted in 1.26.0 and newer.

scan_interval​

If "attack_interval" is 0 or isn't declared, then between attacks: scanning for a new target occurs every amount of ticks equal to "scan_interval", minimum value is 1. Values under 10 can affect performance. Value must be >= 1.

target_acquisition_probability​

Probability (0-1) that the goal will succeed when a candidate target passes all filters. Lower values cause the mob to acquire targets less reliably; the default of 1 always acquires. This item requires a format version of at least 1.21.130.

Legacy FloatRange​

Legacy FloatRange Properties​

JSON path: attack_interval

NameDefault ValueTypeDescription
max0Decimal number
min0Decimal number

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity Types​

List of entity types that this mob considers valid targets.

Entity Types Properties​

JSON path: entity_types

NameDefault ValueTypeDescription
cooldown0Decimal numberThe amount of time in seconds that the mob has to wait before selecting a target of the same type again
filtersnot setMinecraft filterConditions that make this entry in the list valid
max_dist16Decimal numberMaximum distance this mob can be away to be a valid choice
must_seefalseBoolean true/falseIf true, the mob has to be visible to be a valid choice
must_see_forget_duration3Decimal 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
prioritynot setDecimal number
reevaluate_descriptionfalseBoolean true/falseIf true, the targeting entity will continuously reevaluate the target and stop attacking if the target no longer meets the filter conditions.
sprint_speed_multiplier1Decimal numberMultiplier for the running 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

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​

Blaze​
"minecraft:behavior.nearest_attackable_target": {
"must_see": true,
"entity_types": [
{
"filters": {
"AND": [
{
"test": "is_family",
"subject": 1,
"operator": 0,
"value": "player"
}
]
},
"max_dist": 48
}
],
"priority": 2
}
Bogged​
"minecraft:behavior.nearest_attackable_target": {
"reselect_targets": true,
"must_see": true,
"entity_types": [
{
"filters": {
"test": "is_family",
"subject": "other",
"value": "player"
}
},
{
"filters": {
"test": "is_family",
"subject": "other",
"value": "irongolem"
}
},
{
"filters": {
"all_of": [
{
"test": "is_family",
"subject": "other",
"value": "baby_turtle"
},
{
"test": "in_water",
"subject": "other",
"operator": "!=",
"value": true
}
]
}
}
],
"priority": 2
}
Breeze​
"minecraft:behavior.nearest_attackable_target": {
"must_see": true,
"within_radius": 24,
"entity_types": [
{
"filters": {
"AND": [
{
"test": "is_family",
"subject": 1,
"operator": 0,
"value": "player"
}
]
},
"max_dist": 24
},
{
"filters": {
"AND": [
{
"test": "is_family",
"subject": 1,
"operator": 0,
"value": "irongolem"
}
]
},
"max_dist": 24
}
],
"priority": 1
}
Cave Spider​

At /minecraft:entity/component_groups/minecraft:spider_angry/minecraft:behavior.nearest_attackable_target/:

"minecraft:behavior.nearest_attackable_target": {
"attack_interval": {
"min": 10,
"max": 10
},
"must_see": true,
"entity_types": [
{
"filters": {
"any_of": [
{
"test": "is_family",
"subject": "other",
"value": "player"
},
{
"test": "is_family",
"subject": "other",
"value": "snowgolem"
},
{
"test": "is_family",
"subject": "other",
"value": "irongolem"
}
]
}
}
],
"priority": 2
}

At /minecraft:entity/component_groups/minecraft:spider_hostile/minecraft:behavior.nearest_attackable_target/:

"minecraft:behavior.nearest_attackable_target": {
"attack_interval": {
"min": 5,
"max": 5
},
"must_see": true,
"entity_types": [
{
"filters": {
"any_of": [
{
"test": "is_family",
"subject": "other",
"value": "player"
},
{
"test": "is_family",
"subject": "other",
"value": "snowgolem"
},
{
"test": "is_family",
"subject": "other",
"value": "irongolem"
}
]
}
}
],
"priority": 2
}
Drowned​
"minecraft:behavior.nearest_attackable_target": {
"reselect_targets": true,
"must_see": true,
"within_radius": 12,
"must_see_forget_duration": 17,
"persist_time": 0.5,
"entity_types": [
{
"filters": {
"all_of": [
{
"any_of": [
{
"test": "is_family",
"subject": "other",
"value": "player"
},
{
"test": "is_family",
"subject": "other",
"value": "snowgolem"
},
{
"test": "is_family",
"subject": "other",
"value": "irongolem"
},
{
"test": "is_family",
"subject": "other",
"value": "axolotl"
}
]
},
{
"any_of": [
{
"test": "in_water",
"subject": "other",
"value": true
},
{
"test": "is_daytime",
"value": false
}
]
}
]
},
"max_dist": 20
},
{
"filters": {
"all_of": [
{
"any_of": [
{
"test": "is_family",
"subject": "other",
"value": "villager"
},
{
"test": "is_family",
"subject": "other",
"value": "wandering_trader"
}
]
},
{
"any_of": [
{
"test": "in_water",
"subject": "other",
"value": true
},
{
"test": "is_daytime",
"value": false
}
]
}
]
},
"max_dist": 20,
"must_see": false
},
{
"filters": {
"all_of": [
{
"test": "is_family",
"subject": "other",
"value": "baby_turtle"
},
{
"test": "in_water",
"subject": "other",
"operator": "!=",
"value": true
}
]
},
"max_dist": 20
}
],
"priority": 2
}

minecraft:behavior.nearest_prioritized_attackable_target​

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

Allows the mob to check for and pursue the nearest valid target.

Entity Nearest Prioritized Attackable Target Behavior Properties​

NameDefault ValueTypeDescription
attack_interval0Integer numberTime in seconds before selecting a target
control_flags[]Control Flags choices
cooldown0Decimal numberThe amount of time in seconds that the mob has to wait before selecting a target of the same type again
entity_types[]Array of Entity Types itemsList of entity types that this mob considers valid targets
entity_types (Entity Types)not setEntity Types (Entity Types) item
hurt_ownerfalseBoolean true/falseIf true, this mob will also attack mobs that hurt its owner.
must_reachfalseBoolean true/falseIf true, only entities that this mob can path to can be selected as targets
must_seefalseBoolean true/falseIf true, only entities in this mob's viewing range can be selected as targets
must_see_forget_duration3Decimal 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
persist_time0Decimal numberTime in seconds for a valid target to stay targeted when it becomes an invalid target.
priority0Integer numberSpecifies the priority in which filtered enemy types should be attacked. Lower number means higher priority.
reselect_targetsfalseBoolean true/falseIf true, the target will change to the current closest entity whenever a different entity is closer
scan_interval10Integer numberHow many ticks to wait between scanning for a target.
set_persistentfalseBoolean true/falseAllows the actor to be set to persist upon targeting a player
target_search_height-1Decimal numberHeight in blocks to search for a target mob. -1.0f means the height does not matter.
within_radius0Decimal numberDistance in blocks that the target can be within to launch an attack

Control Flags choices​

ValueTitleDescription
jumpJump
lookLook
moveMove

Entity Types​

List of entity types that this mob considers valid targets.

Entity Types Properties​

JSON path: entity_types

NameDefault ValueTypeDescription
cooldown0Decimal numberThe amount of time in seconds that the mob has to wait before selecting a target of the same type again
filtersnot setMinecraft filterConditions that make this entry in the list valid
max_dist16Decimal numberMaximum distance this mob can be away to be a valid choice
must_seefalseBoolean true/falseIf true, the mob has to be visible to be a valid choice
must_see_forget_duration3Decimal 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
reevaluate_descriptionfalseBoolean true/falseIf true, the mob will stop being targeted if it stops meeting any conditions.
sprint_speed_multiplier1Decimal numberMultiplier for the running 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

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​

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