![]() |
VOOZH | about |
This article describes the various components of a mob's AI that control its behavior.
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.
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.
| Sensor | Class | Uses |
|---|---|---|
| dummy | DummySensor | defaulted sensor type |
| nearest_items | NearestItemSensor | |
| nearest_living_entities | NearestLivingEntitySensor |
|
| nearest_players | PlayerSensor | |
| nearest_bed | NearestBedSensor | ๐ Image Villager |
| hurt_by | HurtBySensor |
|
| villager_hostiles | VillagerHostilesSensor | ๐ Image Villager |
| villager_babies | VillagerBabiesSensor | ๐ Image Villager |
| secondary_pois | SecondaryPoiSensor | ๐ Image Villager |
| golem_detected | GolemSensor | ๐ Image Villager |
| armadillo_scare_detected | MobSensor | ๐ Image Armadillo |
| piglin_specific_sensor | PiglinSpecificSensor | ๐ Image Piglin |
| piglin_brute_specific_sensor | PiglinBruteSpecificSensorregister | ๐ Image Piglin |
| hoglin_specific_sensor | HoglinSpecificSensor | ๐ Image Hoglin |
| nearest_adult | AdultSensor | |
| nearest_adult_any_type | AdultSensor | ๐ Image Happy Ghast |
| axolotl_attackables | AxolotlAttackablesSensor | ๐ Image Axolotl |
| food_temptations | TemptingSensor | |
| frog_temptations | TemptingSensor | |
| nautilus_temptations | TemptingSensor | |
| frog_attackables | FrogAttackablesSensor | ๐ Image Frog |
| is_in_water | IsInWaterSensor | ๐ Image Frog |
| warden_entity_sensor | WardenEntitySensor | ๐ Image Warden |
| breeze_attack_entity_sensor | BreezeAttackEntitySensor | ๐ Image Breeze |
| Class | Memory requires | Do tick |
|---|---|---|
| DummySensor | None | Nothing |
| NearestItemSensor | nearest_visible_wanted_item
|
Find the nearest item that:
And save this item in the memory |
| NearestLivingEntitySensor | mobs and visible_mobs
|
Lists all other living entities that are alive and within a cobuoid generated by the mob's hitbox incremented by mob's follow_range in all directions. Sort list by euclidean distance and add to memory mobs.
In
|
| PlayerSensor | nearest_players, nearest_visible_player, nearest_visible_targetable_player and nearest_visible_targetable_players
|
List all non-spectator players to a euclidean distance up to mob's follow_range fro the mobs, sort by euclidean distance and save in nearest_players memory.
From this list, it filters the players who are in the mob's line of sight[a] and within follow range[d]. If it exists, save the first player from the list in memory In memory
If the end list is not empty, save in memory |
| NearestBedSensor | nearest_bed
|
If the mob is baby:
|
| HurtBySensor | huty_by and hurt_by_entity
|
|
| VillagerHostilesSensor | ||
| VillagerBabiesSensor | ||
| SecondaryPoiSensor | ||
| GolemSensor | ||
| MobSensor | ||
| PiglinSpecificSensor | ||
| PiglinBruteSpecificSensorregister | ||
| HoglinSpecificSensor | ||
| AdultSensor | ||
| AxolotlAttackablesSensor | ||
| TemptingSensor | ||
| FrogAttackablesSensor | ||
| IsInWaterSensor | is_in_water
|
If the mob is touching the water, add the memory is_in_water, otherwise remove the memory.
|
| WardenEntitySensor | ||
| BreezeAttackEntitySensor |
mob_visibel a list equal to that of mob is saved, along with a binary list of the same size that indicates whether the entity passes the test or not.
attack_target, this range is multiplied by a modifier that indicates the visibility percentage of the entity. The modifier starting with 1 and cumulatively:
0.8 if it is a sneaking player,0.07 if it is invisible and without equipament in humanoid armor slot,0.175p if it is invisible and has pโฅ1 equipaments in humanoid armor slot,0.5 if it is using the corresponding mob head in the head slot (for skeleton, zombie, piglin, piglin brute, and creeper)RandomInt(x) is a random integer n such that 0 โค n < x.
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.
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.
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 attack or run away from certain blocks or mobs.
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 fish, drowned, dolphins, turtles, guardians and elder guardians.
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 Slow Falling, levitation and the chicken don't fly normally but are able to float in mid-air. Category:Flying mobs contains a list of all mobs that can pathfind in air.
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 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 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 Sunlight | During day, move out of direct line-of-sight with sky | |
| Bow Attack | Attack target with bow | |
| Breathe Air | Mob that can drown tries to move out of water | |
| Cat Sit on Block | Cat sits on bed, chest, or furnace | |
| Chase Boat | Chase after boat ridden by player | Unused |
| Creeper Ignite | Creeper ignites | |
| 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 | |
| Escape Danger | Mob panics and runs away when damaged | |
| Flee Entity | Mob runs away from another mob that it is scared of (e.g. skeletons running from wolves) | |
| Fly | Mob tries to fly | |
| Follow Group 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 | |
| Form Caravan | up to 8 llamas in caravan | |
| Go to Bed and Sleep | Tamed cat sleeps in bed | |
| 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 |
| Long Door Interact | Open a door, then close it after a delay | |
| Look Around | Mob spins around and looks in random directions | |
| Look At Customer | Villager or wandering trader looks at player while trading | |
| Look At Entity | Mob looks at another mob | |
| 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 | |
| Pounce At Target | Mob jumps towards target | cats, foxes, ocelots |
| 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 | |
| Revenge | Target entity that attacked the mob | |
| Wander Around | Move to a nearby random position | |
| 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 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 |
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 | ๐ Image powder snow |
| fence | -1 | ๐ Image fences ๐ Image walls ๐ Image fence gates (closed) |
| lava | -1 | ๐ Image lava |
| unpassable rail | -1 | ๐ Image rail |
| damage - other | -1 | ๐ Image cactus ๐ Image sweet berry bush |
| closed wood door | -1 | ๐ Image wood door |
| closed iron door | -1 | ๐ Image iron door |
| open | 0 | ๐ Image air ๐ Image cave air ๐ Image void air |
| walkable | 0 | ๐ Image TNT with pressure plate on top (under the mob) |
| walkable door | 0 | a door the mob can open |
| trapdoor | 0 | ๐ Image trapdoors ๐ Image lily pad ๐ Image big dripleaf |
| danger - powder snow | 0 | neighboring block is ๐ Image powder snow |
| open door | 0 | open wood or iron door |
| cocoa | 0 | ๐ Image cocoa |
| damage - cautious | 0 | ๐ Image wither rose ๐ Image pointed dripstone |
| danger - trapdoor | 0 | neighboring block is ๐ Image trapdoor |
| breach water | 4 | there is an air block above a water block |
| water | 8 | ๐ Image water |
| water border | 8 | neighboring block is ๐ Image water |
| danger - fire | 8 | neighboring block is: ๐ Image fire ๐ Image lava ๐ Image magma block ๐ Image lit campfire ๐ Image lava cauldron |
| danger - other | 8 | neighboring block is: ๐ Image cactus ๐ Image sweet berry bush |
| honey | 8 | ๐ Image honey block |
| damage - fire | 16 | ๐ Image fire ๐ Image lava ๐ Image magma block ๐ Image lit campfire ๐ Image lava cauldron |
The following mobs override the default pathfinding penalty for some blocks:
| Mob | Penalty Type | Penalty |
|---|---|---|
| ๐ Image axolotl |
water | 0 |
| ๐ Image bee |
damage - fire | -1 |
| water | -1 | |
| cocoa | -1 | |
| fence | -1 | |
| water border | 16 | |
| ๐ Image chicken |
water | 0 |
| ๐ Image fox |
danger - other | 0 |
| damage - other | 0 | |
| ๐ Image frog |
trapdoor | -1 |
| water | 4 | |
| ๐ Image goat |
powder snow | -1 |
| danger - powder snow | -1 | |
| ๐ Image villager ๐ Image wandering trader |
damage-fire | -1 |
| danger - fire | 16 | |
| ๐ Image parrot |
danger-fire | -1 |
| damage - fire | -1 | |
| cocoa | -1 | |
| ๐ Image sniffer |
water | -1 |
| danger - powder snow | -1 | |
| damage - cautious | -1 | |
| ๐ Image strider |
water | -1 |
| lava | 0 | |
| danger - fire | 0 | |
| damage - fire | 0 | |
| ๐ Image turtle |
close iron door | -1 |
| closed wood door | -1 | |
| open door | -1 | |
| water | 0 | |
| ๐ Image wolf |
powder snow | -1 |
| danger - powder snow | -1 | |
| ๐ Image piglin ๐ Image piglin brute |
damage - fire | -1 |
| danger - fire | 16 | |
| ๐ Image blaze |
water | -1 |
| danger - fire | 8 | |
| damage - fire | 8 | |
| lava | 8 | |
| ๐ Image breeze |
danger - trapdoor | -1 |
| damage - fire | -1 | |
| ๐ Image drowned |
water | 0 |
| ๐ Image enderman |
water | -1 |
| ๐ Image guardian |
water | 0 |
| ๐ Image ravager |
leaves | 0 |
| ๐ Image warden |
unpassable rail | 0 |
| damage - fire | 0 | |
| danger - fire | 0 | |
| damage - other | 8 | |
| powder snow | 8 | |
| lava | 8 | |
| water creatures | water | 0 |
| ๐ Image wither skeleton |
lava | 8 |
| ๐ Image zombified piglin |
lava | 8 |
| animal | damage - fire | -1 |
| danger - fire |
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.