Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Mob AI: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
Line 9: Line 9:
=== Sensor ===
=== 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.
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 [[Minecraft:Tick#Game tick|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 {{attr|follow_range}} 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.


{|class= "wikitable collapsible"
{|class= "wikitable collapsible"
Line 195: Line 198:


====Sensor classes====
====Sensor classes====
{{Expand section}}
{{Expand section}}Sensors 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.
{|class= "wikitable collapsible"
{| class="wikitable collapsible"
!Class!! Memory requires!!Do tick
!Class!! Memory requires!!Do tick
|-
|-
|DummySensor
|DummySensor
|''None''
|''None''
|''Nothing''
|''Performs no actions''
|-
|-
|NearestItemSensor
|NearestItemSensor
|{{cd|nearest_visible_wanted_item}}
|{{cd|nearest_visible_wanted_item}}
|Find the {{Tooltip|nearest|with euclidean distance}} item that:
|Find the {{Tooltip|nearest|with euclidean distance}} item that:
* It is to a [[Minecraft:euclidean distance]] of up to 32 blocks from the mob.
* Is within a bounding box extending 32 blocks horizontally and 16 blocks vertically from the mob.
* On the y-axis, it is 16 blocks away from the mob's hitbox.
* Is within 32 blocks of the mob.
* It is in mob line of sight{{fn|grup=sensor|name=los|It is possible to draw a straight line from the mob's eye to the target without intersecting a block [[Minecraft:collision box]].}}.
* The mob wants to pick up.{{fn|grup=sensor|name=dm|It depends on the mob, defined independently of the sensor.}}
* The mob wants to pick up it.{{fn|grup=sensor|name=dm|It depends on the mob, defined independently of the sensor.}}
* Is in the mob's line of sight.{{fn|grup=sensor|name=los|It is possible to draw a straight line from the mob's eye to the target without intersecting a block [[Minecraft:collision box]].}}
And save this item in the memory {{cd|nearest_visible_wanted_item}}.
The nearest matching item is stored in the {{cd|nearest_visible_wanted_item}} memory. If no matching item is found, the memory is set to empty.
|-
|-
|NearestLivingEntitySensor
|NearestLivingEntitySensor
|{{cd|mobs}} and {{cd|visible_mobs}}
|{{cd|mobs}} and {{cd|visible_mobs}}
|Lists all other [[Minecraft:living entities]] that are alive and within a cobuoid generated by the mob's [[Minecraft:Hitbox#Entity hitboxes|hitbox]] incremented by mob's {{attr|follow_range}} in all directions. Sort list by [[Minecraft:euclidean distance]] and add to memory {{cd|mobs}}.
|Lists all other [[Minecraft:living entities]] that are alive and within a [[Minecraft:w:Cuboid|cuboid]] generated by the mob's [[Minecraft:Hitbox#Entity hitboxes|hitbox]] expanded by its {{attr|follow_range}} in all directions. Sorts the entities by [[Minecraft:Euclidean distance]] from the mob and stores the list in the {{cd|mobs}} memory.


In {{cd|visible_mobs}} save the entities of {{cd|mobs}} that{{fn|rup=sensor|Technically, in memory {{cd|mob_visibel}} a list equal to that of {{cd|mob}} is saved, along with a binary list of the same size that indicates whether the entity passes the test or not.}}:
In {{cd|visible_mobs}}, stores the entities from {{cd|mobs}} that:{{fn|rup=sensor|Technically, in memory {{cd|mob_visibel}} a list equal to that of {{cd|mob}} is saved, along with a binary list of the same size that indicates whether the entity passes the test or not.}}
* They 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]].
* They are in mob line of sight{{fn|grup=sensor|name=los}},
* Are in the mob's line of sight.{{fn|grup=sensor|name=los}}
* And they are within a range of {{cd|r}} blocks of the mob, where {{cd|r}} is the {{attr|follow_range}} of the mob{{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 starting with 1 and cumulatively:
* 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 starting with 1 and cumulatively:
* 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}},
* Multiplying by {{cd|0.175p}} if it is invisible and has {{cd|p≥1}} equipaments in humanoid armor slot,
* Multiplying by {{cd|0.175p}} if it is invisible and has {{cd|p≥1}} equipaments in humanoid armor slot,
* 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.}}  
|-
|-
|PlayerSensor
|PlayerSensor
|{{cd|nearest_players}}, {{cd|nearest_visible_player}}, {{cd|nearest_visible_targetable_player}} and {{cd|nearest_visible_targetable_players}}
|{{cd|nearest_players}}, {{cd|nearest_visible_player}}, {{cd|nearest_visible_attackable_player}} and {{cd|nearest_visible_attackable_players}}
|List all non-spectator players to a [[Minecraft:euclidean distance]] up to mob's {{attr|follow_range}} fro the mobs, sort by euclidean distance and save in {{cd|nearest_players}} memory.
|List all non-[[Minecraft:Spectator]] players that are within a [[Minecraft:Euclidean distance]] of the mob's {{attr|follow_range}}. Sorts the players by distance from the mob and stores the list in {{cd|nearest_players}}.


From this list, it filters the players who are in the mob's line of sight{{fn|name=los}} and within follow range{{fn|name=vp}}. If it exists, save the first player from the list in memory {{cd|nearest_visible_player}}.
From this list, it creates {{cd|nearest_visible_player}} 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.{{fn|name=los}} If the resulting list is not empty, stores the first player in {{cd|nearest_visible_player}}.


In memory {{cd|nearest_visible_targetable_players}} saves this last list with the following filters:
Creates {{cd|nearest_visible_attackable_players}} by filtering {{cd|nearest_visible_player}}'s list using the mob's attack targeting conditions:
* If the difficulty is [[Minecraft:peaceful]], remove all players.
* If the difficulty is [[Minecraft:peaceful]], remove all players.
* Remove all players from [[Minecraft:creative mode]].
* Remove all players from [[Minecraft:creative mode]].
* Remove all players from the same [[Minecraft:team]] from the mob.
* Remove all players from the same [[Minecraft:team]] as the mob.
* If the mob is the [[Minecraft:allay]], remove the linked player.
* If the mob is the [[Minecraft:allay]], remove the linked player.
* If the mob is a [[Minecraft:illager]], {{cd|minecraft:player}} is in the tag {{Tag link|entity_type|illager_friends}}, and neither the mob nor the player is on a team, remove the player.
* If the mob is a [[Minecraft:illager]], {{cd|minecraft:player}} is in the tag {{Tag link|entity_type|illager_friends}}, and neither the mob nor the player is on a team, remove the player.
* If the mob is a [[Minecraft:tamed]] animal, remove their owner and the players on the owner's team.
* If the mob is a [[Minecraft:tamed]] animal, remove its owner and the players on the owner's team.
If the end list is not empty, save in memory {{cd|nearest_visible_targetable_player}} the first player on a list.
If the resulting list is not empty, stores the first player in {{cd|nearest_visible_attackable_player}}.
|-
|-
|NearestBedSensor
|NearestBedSensor
|{{cd|nearest_bed}}
|{{cd|nearest_bed}}
|If the mob is baby:
|If the mob is a [[Minecraft:baby]]:
* Set the auxiliary variables {{cd|triedCount {{=}} 0}} and {{cd|lastUpdate {{=}} GameTime + RandomInt(20)}}{{fn|grup=Sensor|name=rInt|{{cd|RandomInt(x)}} is a random integer {{cd|n}} such that {{cd|0 &le; n < x}}.}}, where {{cd|GameTime}} is the total number of [[Minecraft:Tick#Game_tick|game ticks]] that have elapsed in the world.
* Searches for [[Minecraft:Point of Interest|POIs]] of type <code>home</code> ([[Minecraft:Bed]]) within 48 blocks of the mob. The sensor uses a cache to avoid repeatedly checking the same POIs and attempts to add up to 5 new beds to the cache during each scan.
* In the {{cd|batchCache}} [[Minecraft:w:Cache_(computing)|cache]], it attempts to save [[Minecraft:POI]]s of type {{cd|home}} that are up to 48 blocks from the mob at an euclid distance. For each POI found whose position {{cd|Pos}} is not in the cache, it increases {{cd|triedCount}} by 1, if {{cd|triedCount < 5}}, it saves {{cd|(Pos, lastUpdate + 40)}} in the cache. In this way, it saves up to 5 new beds in the {{cd|batchCache}}. The POIs added to the cache create a new set {{cd|pois}}, with the position and type of each POI.
* The sensor attempts to create a [[Minecraft:Mob AI#Pathfinding|path]] to the found beds. If a path is found and can reach its target, and the target is a valid POI, stores the target's position in the mob's {{cd|nearest_bed}} memory.
* Try creating a path to one of the POI in {{cd|pois}}. If it find a path, that path can reach and the target is a POI, save the target's position in mob's memory {{cd|nearest_bed}}.
* If no reachable bed is found, and fewer than 5 POIs were checked, removes expired entries from the cache.
* If the path cannot be found, or the path cannot be reach, and {{cd|triedCount < 5}}, remove from the {{cd|batchcache}} the values where the second coordinate is less than {{cd|lastUpdate}}.
|-
|-
|HurtBySensor
|HurtBySensor
|{{cd|huty_by}} and {{cd|hurt_by_entity}}
|{{cd|hurt_by}} and {{cd|hurt_by_entity}}
|
|Checks the mob's last <code>damageSource</code>.
 
* If the mob has a last damage source, stores it in the {{cd|hurt_by}} memory.
* If the damage source was caused by a [[Minecraft:living entity]], stores that entity in the {{cd|hurt_by_entity}} memory.
* If the mob has no last damage source, removes the {{cd|hurt_by}} memory.
* If the entity stored in {{cd|hurt_by_entity}} is no longer alive or is no longer in the same [[Minecraft:world]], removes the {{cd|hurt_by_entity}} memory.
|-
|-
|VillagerHostilesSensor
|VillagerHostilesSensor
Line 325: Line 332:
{{main|#Pathfinding on land}}
{{main|#Pathfinding on land}}


Mobs movement on land varies wheter 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 [[Minecraft:Mob infighting|attack]] or [[Minecraft:Mob fleeing|run away]] from certain blocks or mobs.
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 [[Minecraft:Mob infighting|attack]] or [[Minecraft:Mob fleeing|run away]] from certain blocks or mobs.


=== Swimming ===
=== Swimming ===
Line 335: Line 342:
{{main|#Pathfinding in air}}
{{main|#Pathfinding in air}}


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 pathfind in air.
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 ==

Revision as of 11:09, 15 July 2026

Template:For Template:WIP

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.

List of Sensor Template:In
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 AdultSensor 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.

Class Memory requires Do tick
DummySensor None Performs no actions
NearestItemSensor Template:Cd Find the Template:Tooltip item that:
  • Is within a bounding box extending 32 blocks horizontally and 16 blocks vertically from the mob.
  • Is within 32 blocks of the mob.
  • The mob wants to pick up.Template:Fn
  • Is in the mob's line of sight.Template:Fn

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

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.

NearestBedSensor Template:Cd If the mob is a Minecraft:baby:
  • Searches for POIs of type home (Minecraft:Bed) within 48 blocks of the mob. The sensor uses a cache to avoid repeatedly checking the same POIs and attempts to add up to 5 new beds to the cache during each scan.
  • The sensor attempts to create a path to the found beds. If a path is found and can reach its target, and the target is a valid POI, stores the target's position in the mob's Template:Cd memory.
  • If no reachable bed is found, and fewer than 5 POIs were checked, removes expired entries from the cache.
HurtBySensor Template:Cd and Template:Cd Checks the mob's last damageSource.
VillagerHostilesSensor
VillagerBabiesSensor
SecondaryPoiSensor
GolemSensor
MobSensor
PiglinSpecificSensor
PiglinBruteSpecificSensorregister
HoglinSpecificSensor
AdultSensor
AxolotlAttackablesSensor
TemptingSensor
FrogAttackablesSensor
IsInWaterSensor Template:Cd If the mob is touching the water, add the memory Template:Cd, otherwise remove the memory.
WardenEntitySensor
BreezeAttackEntitySensor

Template:Fnlist

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

Template:Main

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

Template:Main

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

Template:Main

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.

Lists of mob goals

Lists of goals and associated priorities for individual mobs.

Zombie
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

File:Zombified piglin pathing 1.png
Zombified piglin starts pathfinding to a Minecraft:turtle egg
File:Zombified pigling pathing 2.png
Due to pathfinding penalties, the zombified piglin takes an indirect path to the turtle egg, pathing through wither roses and taking damage, instead of pathing through the lava or magma blocks, which do not damage the zombified piglin

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:

Pathfinding on land

  • All entities Move based off of 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 every 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, there are few entities that can pathfind to air.

See also

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Künstliche Intelligenz Minecraft:ja:Mob AI Minecraft:pt:IA de criatura Minecraft:zh:生物AI