Minecraft:Mob AI: Difference between revisions
More actions
Sync: updated from Minecraft |
Sync: updated from Minecraft |
||
| Line 8: | Line 8: | ||
=== Sensor === | === Sensor === | ||
Sensors are used to detect if a mob with a brain can perform certain tasks. Examples of sensors include | Sensors are used to detect if a mob with a brain can perform certain tasks. Examples of sensors include a sensor to detect if an armadillo should be scared, a sensor to detect the nearest player, and a sensor to detect if a mob is in water. | ||
| Line 221: | Line 221: | ||
|Searches the {{cd|mobs}} memory for an [[Minecraft:iron golem]]. If one is found, it sets the {{cd|golem_detected_recently}} memory to <code>true</code> with an expiration time of {{convert|599|gt|s}}. | |Searches the {{cd|mobs}} memory for an [[Minecraft:iron golem]]. If one is found, it sets the {{cd|golem_detected_recently}} memory to <code>true</code> with an expiration time of {{convert|599|gt|s}}. | ||
This sensor runs every 200 game ticks (10 seconds) by default. It only checks whether at least one iron golem is present. | This sensor runs every 200 game ticks (10 seconds) by default. It only checks whether at least one iron golem is present. | ||
|- | |||
|HoglinSpecificSensor | |||
|{{cd|nearest_visible_living_entities}}, {{cd|nearest_repellent}}, {{cd|nearest_visible_adult_piglin}}, {{cd|nearest_visible_adult_hoglins}}, {{cd|visible_adult_piglin_count}}, and {{cd|visible_adult_hoglin_count}} | |||
|Searches the {{cd|nearest_visible_living_entities}} memory for visible adult [[Minecraft:piglin]]s and [[Minecraft:hoglin]]s. | |||
Stores the nearest visible adult [[Minecraft:piglin]] in the {{cd|nearest_visible_adult_piglin}} memory and stores visible adult [[Minecraft:hoglin]]s in the {{cd|nearest_visible_adult_hoglins}} memory. It also stores the number of visible adult piglins and hoglins in the {{cd|visible_adult_piglin_count}} and {{cd|visible_adult_hoglin_count}} memories. | |||
Searches for the nearest hoglin repellent block within 8 blocks horizontally and 4 blocks vertically, and stores its position in the {{cd|nearest_repellent}} memory. | |||
|- | |- | ||
|HurtBySensor | |HurtBySensor | ||
| Line 259: | Line 267: | ||
* Are not a [[Minecraft:Spectator]] player or an invisible or marker [[Minecraft:armor stand]]. | * Are not a [[Minecraft:Spectator]] player or an invisible or marker [[Minecraft:armor stand]]. | ||
* Are in the mob's line of sight.{{fn|grup=sensor|name=los}} | * Are in the mob's line of sight.{{fn|grup=sensor|name=los}} | ||
* Are within a range of {{cd|r}} blocks of the mob, where {{cd|r}} is the {{attr|follow_range}}.{{fn|grup=sensor|name=vp| For entities that are not in mob's memory {{cd|attack_target}}, this range is multiplied by a modifier that indicates the visibility percentage of the entity. The modifier | * Are within a range of {{cd|r}} blocks of the mob, where {{cd|r}} is the {{attr|follow_range}}.{{fn|grup=sensor|name=vp| For entities that are not in the mob's memory {{cd|attack_target}}, this range is multiplied by a modifier that indicates the visibility percentage of the entity. The modifier starts with 1 and is cumulative: | ||
* Multiplying by {{cd|0.8}} if it is a [[Minecraft:sneaking]] player, | * Multiplying by {{cd|0.8}} if it is a [[Minecraft:sneaking]] player, | ||
* Multiplying by {{cd|0.07}} if it is [[Minecraft:invisible]] and without equipament in {{tooltip|humanoid armor slot|head, chest, legs or feet slot}}, | * Multiplying by {{cd|0.07}} if it is [[Minecraft:invisible]] and without equipament in {{tooltip|humanoid armor slot|head, chest, legs or feet slot}}, | ||
| Line 265: | Line 273: | ||
* Multiplying by {{cd|0.5}} if it is using the corresponding mob [[Minecraft:head]] in the {{cd|head}} slot (for [[Minecraft:skeleton]], [[Minecraft:zombie]], [[Minecraft:piglin]], [[Minecraft:piglin brute]], and [[Minecraft:creeper]]) | * Multiplying by {{cd|0.5}} if it is using the corresponding mob [[Minecraft:head]] in the {{cd|head}} slot (for [[Minecraft:skeleton]], [[Minecraft:zombie]], [[Minecraft:piglin]], [[Minecraft:piglin brute]], and [[Minecraft:creeper]]) | ||
The final range must be at least 2.}} | The final range must be at least 2.}} | ||
|- | |||
|PiglinBruteSpecificSensor | |||
|{{cd|nearest_visible_living_entities}}, {{cd|nearest_visible_nemesis}}, and {{cd|nearby_adult_piglins}} | |||
|Searches the {{cd|nearest_visible_living_entities}} memory for the nearest [[Minecraft:wither skeleton]] or [[Minecraft:wither]] and stores it in the {{cd|nearest_visible_nemesis}} memory. | |||
Stores nearby adult [[Minecraft:piglin]]s in the {{cd|nearby_adult_piglins}} memory. | |||
|- | |||
|PiglinSpecificSensor | |||
|{{cd|nearest_visible_living_entities}}, {{cd|nearest_living_entities}}, {{cd|nearest_visible_nemesis}}, {{cd|nearest_targetable_player_not_wearing_gold}}, {{cd|nearest_player_holding_wanted_item}}, {{cd|nearest_visible_huntable_hoglin}}, {{cd|nearest_visible_baby_hoglin}}, {{cd|nearest_visible_adult_piglins}}, {{cd|nearby_adult_piglins}}, {{cd|visible_adult_piglin_count}}, {{cd|visible_adult_hoglin_count}}, and {{cd|nearest_repellent}} | |||
|Searches the {{cd|nearest_visible_living_entities}} memory and updates memories related to [[Minecraft:piglin]] behavior. | |||
Stores the nearest visible [[Minecraft:wither skeleton]] or [[Minecraft:wither]] as {{cd|nearest_visible_nemesis}}, the nearest visible huntable [[Minecraft:hoglin]] as {{cd|nearest_visible_huntable_hoglin}}, and the nearest visible [[Minecraft:baby hoglin]] as {{cd|nearest_visible_baby_hoglin}}. | |||
Stores the nearest visible player that is not wearing [[Minecraft:golden armor]] and can be attacked in {{cd|nearest_targetable_player_not_wearing_gold}}. Stores the nearest visible player holding a [[Minecraft:Piglin#Piglin loved items|loved item]] in {{cd|nearest_player_holding_wanted_item}}. | |||
Stores nearby adult piglins in {{cd|nearby_adult_piglins}} and visible adult piglins in {{cd|nearest_visible_adult_piglins}}. It also stores the number of visible adult piglins and adult hoglins in {{cd|visible_adult_piglin_count}} and {{cd|visible_adult_hoglin_count}}, respectively. | |||
Searches for the nearest piglin repellent block within 8 blocks horizontally and 4 blocks vertically, and stores its position in {{cd|nearest_repellent}}. Lit [[Minecraft:soul campfire]]s are considered repellents. | |||
|- | |- | ||
|PlayerSensor | |PlayerSensor | ||
| Line 308: | Line 334: | ||
If no matching hostile entity is found, {{cd|nearest_hostile}} is set to empty. | If no matching hostile entity is found, {{cd|nearest_hostile}} is set to empty. | ||
|- | |- | ||
|AxolotlAttackablesSensor | |AxolotlAttackablesSensor | ||
Revision as of 11:12, 18 July 2026
This article describes the various components of a mob's AI that control its behavior.
Brain
Some mobs use a complex AI system called a brain. A mob's brain stores memories (data), a list of tasks that can be performed, and a list of sensors used to determine which tasks it can perform.
Sensor
Sensors are used to detect if a mob with a brain can perform certain tasks. Examples of sensors include a sensor to detect if an armadillo should be scared, a sensor to detect the nearest player, and a sensor to detect if a mob is in water.
By default, sensors run once every 20 game ticks (1 second), although individual sensor classes can have a different scan rate. When a sensor runs, it updates its targeting conditions to match the mob's current Template:Attr attribute before performing its detection logic. The first execution of each sensor is delayed by a random number of ticks, preventing multiple sensors from running simultaneously.
| Sensor | Class | Uses |
|---|---|---|
| dummy | DummySensor | defaulted sensor type |
| nearest_items | NearestItemSensor | Template:Flatlist |
| nearest_living_entities | NearestLivingEntitySensor | Template:Flatlist |
| nearest_players | PlayerSensor | Template:Flatlist |
| nearest_bed | NearestBedSensor | Template:EntityLink |
| hurt_by | HurtBySensor | Template:Flatlist |
| villager_hostiles | VillagerHostilesSensor | Template:EntityLink |
| villager_babies | VillagerBabiesSensor | Template:EntityLink |
| secondary_pois | SecondaryPoiSensor | Template:EntityLink |
| golem_detected | GolemSensor | Template:EntityLink |
| armadillo_scare_detected | MobSensor | Template:EntityLink |
| piglin_specific_sensor | PiglinSpecificSensor | Template:EntityLink |
| piglin_brute_specific_sensor | PiglinBruteSpecificSensorregister | Template:EntityLink |
| hoglin_specific_sensor | HoglinSpecificSensor | Template:EntityLink |
| nearest_adult | AdultSensor | Template:Flatlist |
| nearest_adult_any_type | AdultSensorAnyType | Template:EntityLink |
| axolotl_attackables | AxolotlAttackablesSensor | Template:EntityLink |
| food_temptations | TemptingSensor | Template:Flatlist |
| frog_temptations | TemptingSensor | Template:Flatlist |
| nautilus_temptations | TemptingSensor | Template:Flatlist |
| frog_attackables | FrogAttackablesSensor | Template:EntityLink |
| is_in_water | IsInWaterSensor | Template:EntityLink |
| warden_entity_sensor | WardenEntitySensor | Template:EntityLink |
| breeze_attack_entity_sensor | BreezeAttackEntitySensor | Template:EntityLink |
Sensor classes
Template:Expand sectionSensors classes are responsible for detecting a specific type of information and storing the results in one or more memory modules in a mob's brain. In the game's code, these classes are part of the package Template:Cd
| Class | Memory requires | Do tick |
|---|---|---|
| DummySensor | None | Performs no actions |
| AdultSensor | Template:Cd and Template:Cd | Searches the Template:Cd memory for the nearest visible Minecraft:living entity of the same Minecraft:entity type as the mob that is not a Minecraft:baby. Stores the result in the Template:Cd memory.
If no matching adult is found, Template:Cd is set to empty. |
| AdultSensorAnyType |
Extends AdultSensor When setting the nearest visible adult, it tests if the entity is in the tag Template:Tag link, instead of testing if it's in the same entity type as the mob. | |
| GolemSensor | Template:Cd and Template:Cd | Searches the Template:Cd memory for an Minecraft:iron golem. If one is found, it sets the Template:Cd memory to true with an expiration time of Template:Convert.
This sensor runs every 200 game ticks (10 seconds) by default. It only checks whether at least one iron golem is present. |
| HoglinSpecificSensor | Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, and Template:Cd | Searches the Template:Cd memory for visible adult Minecraft:piglins and Minecraft:hoglins.
Stores the nearest visible adult Minecraft:piglin in the Template:Cd memory and stores visible adult Minecraft:hoglins in the Template:Cd memory. It also stores the number of visible adult piglins and hoglins in the Template:Cd and Template:Cd memories. Searches for the nearest hoglin repellent block within 8 blocks horizontally and 4 blocks vertically, and stores its position in the Template:Cd memory. |
| HurtBySensor | Template:Cd and Template:Cd | Checks the mob's last damageSource.
|
| MobSensor | Template:Cd | If the sensor's readiness condition is met, it searches the Template:Cd memory for a Minecraft:living entity matching the sensor's predicate. If a matching entity is found, it sets the sensor's memory to true with an expiration time determined by the sensor.
If the readiness condition is not met, it removes the sensor's memory. |
| NearestBedSensor | Template:Cd | If the mob is a Minecraft:baby:
|
| NearestItemSensor | Template:Cd | Find the Template:Tooltip item that:
The nearest matching item is stored in the Template:Cd memory. If no matching item is found, the memory is set to empty. |
| NearestLivingEntitySensor | Template:Cd and Template:Cd | Lists all other Minecraft:living entities that are alive and within a cuboid generated by the mob's hitbox expanded by its Template:Attr in all directions. Sorts the entities by Minecraft:Euclidean distance from the mob and stores the list in the Template:Cd memory.
In Template:Cd, stores the entities from Template:Cd that:Template:Fn
|
| PiglinBruteSpecificSensor | Template:Cd, Template:Cd, and Template:Cd | Searches the Template:Cd memory for the nearest Minecraft:wither skeleton or Minecraft:wither and stores it in the Template:Cd memory.
Stores nearby adult Minecraft:piglins in the Template:Cd memory. |
| PiglinSpecificSensor | Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, Template:Cd, and Template:Cd | Searches the Template:Cd memory and updates memories related to Minecraft:piglin behavior.
Stores the nearest visible Minecraft:wither skeleton or Minecraft:wither as Template:Cd, the nearest visible huntable Minecraft:hoglin as Template:Cd, and the nearest visible Minecraft:baby hoglin as Template:Cd. Stores the nearest visible player that is not wearing Minecraft:golden armor and can be attacked in Template:Cd. Stores the nearest visible player holding a loved item in Template:Cd. Stores nearby adult piglins in Template:Cd and visible adult piglins in Template:Cd. It also stores the number of visible adult piglins and adult hoglins in Template:Cd and Template:Cd, respectively. Searches for the nearest piglin repellent block within 8 blocks horizontally and 4 blocks vertically, and stores its position in Template:Cd. Lit Minecraft:soul campfires are considered repellents. |
| PlayerSensor | Template:Cd, Template:Cd, Template:Cd and Template:Cd | List all non-Minecraft:Spectator players that are within a Minecraft:Euclidean distance of the mob's Template:Attr. Sorts the players by distance from the mob and stores the list in Template:Cd.
From this list, it creates Template:Cd by filtering players using the mob's targeting conditions, which checks that the player is targetable, including being within follow range and in the mob's line of sight.Template:Fn If the resulting list is not empty, stores the first player in Template:Cd. Creates Template:Cd by filtering Template:Cd's list using the mob's attack targeting conditions:
If the resulting list is not empty, stores the first player in Template:Cd. |
| SecondaryPoiSensor | Template:Cd | Scans all blocks within a Template:Tooltip area centered on a villager. If a block matches one of the villager profession's secondary job site blocks, it stores its global position in the Template:Cd memory. It stores all matching blocks.
If no matching blocks are found, it removes the Template:Cd memory. This sensor runs every 40 game ticks (2 seconds) instead of the default 20. |
| VillagerBabiesSensor | Template:Cd | Finds all villagers that are babies from the mob's Template:Cd memory and stores them as a list in the Template:Cd memory.
If no visible baby villagers are found, stores an empty list. |
| VillagerHostilesSensor | Template:Cd and Template:Cd | Searches the Template:Cd memory for the nearest Minecraft:living entity matching one of the following hostile entity types and stores it in the Template:Cd memory:
If no matching hostile entity is found, Template:Cd is set to empty. |
| AxolotlAttackablesSensor | ||
| TemptingSensor | ||
| FrogAttackablesSensor | ||
| IsInWaterSensor | Template:Cd | If the mob is touching the water, add the memory Template:Cd, otherwise remove the memory. |
| WardenEntitySensor | ||
| BreezeAttackEntitySensor |
Task
Tasks are activities that mobs with brain AI systems can perform. Sensors are used to determine if a task can be performed, and tasks may use information stored in memories. Examples of tasks include a villager walking to its jobsite, a piglin admiring an item, or a warden emerging. Tasks have priorities, so tasks with a higher priority will over run tasks with lower priority, for example, if a zombie is wandering and it sees a player, it will switch tasks to attacking.
Memory
Memories are used to store data, and are used when mobs perform tasks. Examples of memories include a list of all visible mobs in range, the location of a villager's jobsite block, and any cooldowns the mob may have.
Control
Walking
Mobs movement on land varies whether it's hostile or passive. Hostile mobs will try to approach and attack the player when within their detection range, while most passive mobs will attempt to run away when attacked. Some mobs will also try to attack or run away from certain blocks or mobs.
Swimming
Mobs swimming works the same way as walking, but in water. While most mobs will just float on water or sink, some can properly swim like Minecraft:fish, Minecraft:drowned, Minecraft:dolphins, Minecraft:turtles, Minecraft:guardians and Minecraft:elder guardians.
Flying
Mobs flying works the same way as walking, but in air. Most mobs will just fall when suspended in air, with a few exceptions. Mobs with Minecraft:Slow Falling, Minecraft:levitation and the Minecraft:chicken don't fly normally but are able to float in mid-air. [[Minecraft::Category:Flying mobs]] contains a list of all mobs that can path find in air.
Goals
Goals are a simple AI system used primarily by mobs already existed before the brain AI. However, there are recent mobs that use both AIs simultaneously, for example, the Minecraft:happy ghast.
Goals can range from wandering around, opening doors, attacking another mob, and more. Each type of mob that uses goals has its own defined list of goals, and each goal has a priority. Mobs attempt to perform the lowest priority goal they can, and may switch goals if there is an opportunity to pursue a lower priority goal. For example, if a zombie is targeting and chasing a villager (priority of 3) and a player comes within the detection range of the zombie, the zombie may target and chase the player (priority of 2) instead.
List of goals
List of goals that are used by many different mobs.
| Goal | Description | Notes |
|---|---|---|
| Active Target | Select an entity to target for chasing and attacking | |
| Ambient Stand | Untamed horse bucks when player tries to ride it | |
| Attack | Attack target | |
| Attack with Owner | Tamed animal attacks a target mob attacked by owner | |
| Avoid Entity | Mob runs away from another mob that it is afraid of (e.g. skeletons running from wolves) | |
| Bow Attack | Attack target with bow | |
| Breathe Air | Mob that can drown tries to move out of water | |
| Cat Lie on Bed | Tamed cat lies down on bed | |
| Cat Sit on Block | Cat sits on bed, chest, or furnace | |
| Chase Boat | Chase after boat ridden by player | Unused |
| Crossbow Attack | Attack target with crossbow | |
| Destroy Egg | Destroy turtle eggs | |
| Disableable Follow Target | Raid entity stops following target | Unused |
| Dive Jump | Mob jumps up and dives down | |
| Dolphin Jump | Dolphin jumps out of water | |
| Door Interact | Mob tries to open a door | |
| Eat Grass | Mob grazes on grass | |
| Flee Sun | Move out of direct line-of-sight with sky during day | |
| Float | Mob floats in water | |
| Follow Flock Leader | Fish tries to follow the leader of a school of fish | |
| Follow Mob | Mob follows another mob | |
| Follow Owner | Tamed mob follows owner | |
| Follow Parent | Baby mob follows its parent | |
| Go to Walk Target | Mob walks to a target | |
| Hold in Hands | Mob holds an item in its main hand | |
| Horse Bond with Player | Horse attempts to bond with player attempting to tame it | |
| Iron Golem Look | Iron golem looks at a villager | |
| Iron Golem Wander Around | Iron golem wanders around village | uses points of interest |
| Llama Follow Caravan | Llamas form and follow a caravan | |
| Leap At Target | Mob jumps towards target | cats, foxes, ocelots, spiders |
| Long Door Interact | Open a door, then close it after a delay | |
| Look At Entity | Mob looks at another mob | |
| Look At Player | Mob looks at player | |
| Look At Trading Player | Villager or wandering trader looks at player while trading | |
| Melee Attack | Mob paths to target and attacks | |
| Move Into Water | Mob paths to water | |
| Move Through Village | Mob moves between points of interest in a village | |
| Move To Raid Center | Raiders move toward village after spawning | |
| Move To Target Position | Mob paths to a specific block | |
| Panic | Mob panics and runs away when damaged | |
| Powder Snow Jump | Mob dives into powder snow | foxes |
| Prioritized Goal | Used to override the default priority of a goal | |
| Projectile Attack | Mob attacks target with a projectile | arrow, spit, trident, potion, snow ball, wither skull, not fireballs |
| Raid Goal | Raiders target villagers | |
| Random Look Around | Mob looks around in random directions | |
| Random Stroll | Move to a nearby random position | |
| Revenge | Target entity that attacked the mob | |
| Run Around Like Crazy | Untamed horse runs around randomly when ridden by a player | |
| Spear Use | Mob attacks target with spear | |
| Swell | Creeper attempts to explode near its target | |
| Tempt | Mob follows player holding breeding item | |
| Water Avoiding Random Stroll | Move to a nearby random position, while actively avoiding water | |
| Wander Around Far | Move to a random position, sometimes farther away than Wander Around goal | |
| Zombie Attack | Attack goal for zombies and zombie variants |
Lists of mob goals
Lists of goals and associated priorities for individual mobs.
| Goal | Priority | Notes |
|---|---|---|
| Revenge | 1 | Attack entity that damaged the zombie |
| Active Target - Player | 2 | Target the player |
| Zombie Attack | 2 | Attack current target |
| Active Target - Iron Golem | 3 | Target Iron Golem |
| Active Target - Merchant | 3 | Target Villager or Wandering Trader |
| Destroy Egg | 4 | Break turtle eggs |
| Active Target - Turtle | 5 | Target baby turtle |
| Wander Around Far | 7 | |
| Look Around | 8 | Looks away from Entities |
| Look at Entity | 8 | Looks at nearest Entities |
Pathfinding
Pathfinding penalties
When pathfinding to a target, mobs will sometimes avoid certain blocks (usually blocks that cause damage or slow the mob down). These blocks have a penalty associated with them. Generally, mobs try to path through blocks with the smallest penalty. There are some blocks that most mobs cannot path through; these all have a penalty of -1.
The following table is a list of all pathfinding penalties and their default values. Each type of pathfinding (land, water, air) uses its own subset of these penalties. Some mobs override these default values.
| Penalty type | Penalty | Description |
|---|---|---|
| blocked | -1 | can't pathfind through block (most full solid blocks) |
| powder snow | -1 | Template:BlockLink |
| fence | -1 | Template:BlockLink Template:BlockLink Template:BlockLink (closed) |
| lava | -1 | Template:BlockLink |
| unpassable rail | -1 | Template:BlockLink |
| damage - other | -1 | Template:BlockLink Template:BlockLink |
| closed wood door | -1 | Template:BlockLink |
| closed iron door | -1 | Template:BlockLink |
| open | 0 | Template:BlockLink Template:BlockLink Template:BlockLink |
| walkable | 0 | Template:BlockLink with pressure plate on top (under the mob) |
| walkable door | 0 | a door the mob can open |
| trapdoor | 0 | Template:BlockLink Template:BlockLink Template:BlockLink |
| danger - powder snow | 0 | neighboring block is Template:BlockLink |
| open door | 0 | open wood or iron door |
| cocoa | 0 | Template:BlockLink |
| damage - cautious | 0 | Template:BlockLink Template:BlockLink |
| danger - trapdoor | 0 | neighboring block is Template:BlockLink |
| breach water | 4 | there is an air block above a water block |
| water | 8 | Template:BlockLink |
| water border | 8 | neighboring block is Template:BlockLink |
| danger - fire | 8 | neighboring block is: Template:BlockLink Template:BlockLink Template:BlockLink Template:BlockLink Template:BlockLink |
| danger - other | 8 | neighboring block is: Template:BlockLink Template:BlockLink |
| honey | 8 | Template:BlockLink |
| damage - fire | 16 | Template:BlockLink Template:BlockLink Template:BlockLink Template:BlockLink Template:BlockLink |
- Mob pathfinding penalty overrides
The following mobs override the default pathfinding penalty for some blocks:
| Mob | Penalty Type | Penalty |
|---|---|---|
| Template:EntityLink | water | 0 |
| Template:EntityLink | damage - fire | -1 |
| water | -1 | |
| cocoa | -1 | |
| fence | -1 | |
| water border | 16 | |
| Template:EntityLink | water | 0 |
| Template:EntityLink | danger - other | 0 |
| damage - other | 0 | |
| Template:EntityLink | trapdoor | -1 |
| water | 4 | |
| Template:EntityLink | powder snow | -1 |
| danger - powder snow | -1 | |
| Template:EntityLink Template:EntityLink |
damage-fire | -1 |
| danger - fire | 16 | |
| Template:EntityLink | danger-fire | -1 |
| damage - fire | -1 | |
| cocoa | -1 | |
| Template:EntityLink | water | -1 |
| danger - powder snow | -1 | |
| damage - cautious | -1 | |
| Template:EntityLink | water | -1 |
| lava | 0 | |
| danger - fire | 0 | |
| damage - fire | 0 | |
| Template:EntityLink | close iron door | -1 |
| closed wood door | -1 | |
| open door | -1 | |
| water | 0 | |
| Template:EntityLink | powder snow | -1 |
| danger - powder snow | -1 | |
| Template:EntityLink Template:EntityLink |
damage - fire | -1 |
| danger - fire | 16 | |
| Template:EntityLink | water | -1 |
| danger - fire | 8 | |
| damage - fire | 8 | |
| lava | 8 | |
| Template:EntityLink | danger - trapdoor | -1 |
| damage - fire | -1 | |
| Template:EntityLink | water | 0 |
| Template:EntityLink | water | -1 |
| Template:EntityLink | water | 0 |
| Template:EntityLink | leaves | 0 |
| Template:EntityLink | unpassable rail | 0 |
| damage - fire | 0 | |
| danger - fire | 0 | |
| damage - other | 8 | |
| powder snow | 8 | |
| lava | 8 | |
| water creatures | water | 0 |
| Template:EntityLink | lava | 8 |
| Template:EntityLink | lava | 8 |
| animal | damage - fire | -1 |
| danger - fire |
Pathfinding on land
- All entities move based on random targets that are generated every tick with a priority toward their entity-specific goals.
- These targets can be located anywhere in 3D space within the entity range and are only generated when wandering or when they have no goals.
- For every target, a path is generated; with the entity preferring the path with the lowest score regarding the Pathfinding penalties.
- If an entity cannot take any paths with a low enough score, or any paths without a score of -1, the entity will not move until one is found.
- If an entity's target is located inside a block (including water), the target is moved to the nearest air block above it.
This means every entity, when wandering, will always prefer to pathfind to a block with the most blocks below it within range.
Due to the higher chance that a target will be generated within the blocks below it and moved up to the nearest air block above before generating a path.
Pathfinding in water
- Pathfinding in water is roughly the same as land; however, most entities, excluding fish and drowned, will bounce on the surface, preferring land due to the Pathfinding penalties of water.
Pathfinding in air
- Pathfinding in air is roughly the same as land; however, few entities can pathfind to air.
See also
Template:Navbox Java Edition technical
Minecraft:de:Künstliche Intelligenz Minecraft:ja:Mob AI Minecraft:pt:IA de criatura Minecraft:zh:生物AI