VOOZH about

URL: https://minecraft.wiki/w/Talk:Mob_AI

⇱ Talk:Mob AI – Minecraft Wiki


Talk:Mob AI

From Minecraft Wiki
Latest comment: 8 February by Aloi4 in topic What is the list of goals?
Jump to navigation Jump to search

Better name

[edit source]
Latest comment: 22 March 20122 comments2 people in discussion

I think Mob Behavior is a better name for this article. –ultradude25 (T|C) at 07:13, 20 March 2012 (UTC)

The goal of this article is to comprehensively cover all the Mobs AI systems and their behavior. Behavior could be a better name, but ultimately, the AI is what allows for their "behavior". This article should document the how the mob AI works or how it allows for specific mob behavior, and analyze the mobs behavior during certain situations. I'm hoping that there will be many scenarios documented here. - Asterick6 04:46, 22 March 2012 (UTC)

Hostile Mob AI before 1.2

[edit source]

Should add note that hostile mobs will not chase over lava, 1.0,1.1,1.2 this has been verified.

[Anon]

Edited the skeleton behaviour list

[edit source]
Latest comment: 21 June 20121 comment1 person in discussion

I have replaced "Skeletons will evade the player when hit, and will constantly maintain a certain amount of distance between itself and the mob it is attacking while firing its arrows."

with my own, mentioning that the skeleton will circle the player with a constant radius. If this is incorrect, please let me know. Jishaxe 12:35, 21 June 2012 (UTC)

What are houses to villagers?

[edit source]
Latest comment: 27 April 20132 comments2 people in discussion

So I've done some pretty extensive research to finally answer the question: What is a house to a villager?

Here are all of my notes while experimenting with villagers and houses...

I've had to use PasteBin to submit the data as the wiki completely butchers the formatting. I hope this isn't again any rule and if so please let me know as I'm sure you will. See it here.

Also, since this is my first contribution, I wasn't sure how to directly integrate any of it into the actual page so I'll let someone else do that if there's any interest.

I can also provide screenshots if need be.

BlueKoda –The preceding undated comment was added on 08:32, 22 July 2012. Please sign your posts with ~~~~

Looks good, I'm adding it in. Next time just add it as a new subsection under the Villager section. --M0rphzone(talk) (*How to remove sidebar*) 23:48, 3 September 2012 (UTC)
In 1.5.1, this information conflicts with Tutorials/Village mechanics#Housing and testing agrees with other page. frogjg2003 06:03, 27 April 2013 (UTC)

What is a cave to a bat?

[edit source]
Latest comment: 11 November 20122 comments2 people in discussion

From looking at the source code to Minecraft, a bat recognizes a cave (for spawning) if it meets these conditions:

  1. The Y-Coordinate is less than or equal to 63
  2. Something involving a calendar (which I think is checking weather the date is Halloween) that seems to allow bats to spawn in light level 7
  3. Fails to spawn if a random number between 0 (inclusive) and the acceptable light level (exclusive)(Which is 4 unless the above is true) is more than the light level at the position the bat is trying to spawn, and otherwise will preform the check for all mobs of weather it is in a wall.

I don't want to add this into the page because I am not sure of the info. Also, the calendar seems to used to check the current time in milliseconds, but all else is stored on login. Pokechu22 01:41, 11 November 2012 (UTC)

The effect of the code involving the calendar is that between October 20 and November 3, bats can spawn in light levels up to 7. The rest of the year, they can spawn in light levels up to 4, and have a 50% chance of not spawning anyway. -- Orthotope 03:28, 11 November 2012 (UTC)

Snowmen

[edit source]
Latest comment: 4 December 20121 comment1 person in discussion

I know its a pretty straight forward mob, but i think it should be included in this article. 209.65.242.121 12:23, 4 December 2012 (UTC)TowerTD

Giant do not move

[edit source]

all you see is giant standing still and looking around, 1.8 giants don't do anything (hint: giants don't do anything in 1.8 cause of armor on them)

Mob Stupidity, Wanderlust, and Playfulness

[edit source]
Latest comment: 13 August 20141 comment1 person in discussion

This article seems to lack a couple aspects I've noticed in mobs, particularly Villagers and Chickens.

First, they seem to want to climb up or jump up anything they can get to. Villagers will jump up my shelves and get onto the roof area of my building during construction; they also jump straight into my cooking pot (Pam's HarvestCraft) and hop around while looking at their feet. Chickens seem to love to climb up areas and jump off, repeatedly.

Almost any time you open a fence gate, chickens will head straight for it. I've seen this behavior with other mobs too (sheep, cows, pigs), but chickens are slippery little devils; I don't know if they do it more often or are just more annoying when they do it (or if it's because I tend to have more chickens in a flock than other animals in their herds). Villagers likewise tend to run through fence gates when available.

Together, these two aspects make for some interesting behavior. Villagers and animals both seem inclined to escape their cages. Villagers seem suicidally stupid, going up to high places, looking over the edge, and falling off - sometimes pushed by their buddies, so maybe it's more homicidal than suicidal, though certainly they'll do it on their own, over and over. And chickens are playful: Not only will they climb up and jump off blocks, making for awesome amusement rides, but they seem to enjoy water and seek it out; before water started killing my chicks, I'd make "Chicken Enrichment Centers" to give them interesting things to do while they donated their eggs.

Can anyone confirm what sort of behavior is actually happening here, and put up notes to this effect on the page? Kilyle (talk) 08:58, 13 August 2014 (UTC)

Delete

[edit source]
Latest comment: 18 April 20155 comments4 people in discussion

I honestly believe this page should be deleted, as it essentially contains a brief (and some parts outdated) overview of what is already available on the respective mob pages. GoandgooTalk
Contribs
Edits
06:41, 13 November 2014 (UTC)

👁 Image
 Support. I think some generic info may be kept as a section on the Mobs article, as well as the video. -- ♦ 👁 Image
👁 Image
07:06, 13 November 2014 (UTC)
👁 Image
 Tagged for merging. -- ♦ 👁 Image
👁 Image
07:10, 13 November 2014 (UTC)
👁 Image
 Agree. LauraFi · talk 22:55, 21 November 2014 (UTC)
👁 Image
 Agree I agree too. -AgrastiOs (talk) 20:44, 18 April 2015 (UTC)

Study Potential

[edit source]
Latest comment: 30 September 20257 comments2 people in discussion

This page has so much potential especially since the topic is imo not very well understood. Is there a dedicated area of discussion?
Some practical applications off the top of my head as a rationale for this page:

  • Sensor system underlies some detection-based mechanics such as villager-iron-golem detection, wither-skeleton-piglin detection, etc.
    These mostly depends on the mob's follow range that actually have a random components (i.e. some villagers can detect golems slightly shorter/further than 16 blocks).
    There's probably some overlap between some information here and the distance page.
  • Brain governs villager behaviours and most of the newer mobs.
    While mob-specific behaviours I think is already appropriately placed at their respective pages, there are probably some generic brain mechanics that may be useful like how they are prioritised, scheduled, and executed in general, similar to how thie video by vktec outlines the general mob goal system that are still largely applicable to mobs introduced in earlier versions.
  • Pathfinding algorithm is applicable in a wide range of areas including, but not limited to:
    • Understanding and fixing odd behaviours like mobs clumping up often observed near large hills/mountains and their propensity to climb
    • Understanding exactly how and when villagers have pathing access to job sites/beds for breeding/trading halls
    • Understanding how areas can be pathfinding-isolated to keep mobs/bed/job site/etc. contained

I haven't looked into the brain/goal system all that much yet. But I'm trying to study the pathfinding algorithm the game uses.


Pathfinding

From my reading so far, the game is using the A* pathfinding algorithm implemented using min-heap with the following details:

  • g(n) = penalised path cost from the start to the node
    This is the euclidean distance between each consecutive nodes in the path and each of the node's penalty, if any.
  • h(n) = 1.5 * euclidean distance from the node to the target
  • Limit to the total number of nodes that can be evaluated based on the mob's base follow range (prevents run-away search when solution may not exist)
  • When the target hasn't been reached, a node that is closest to the target by manhattan distance is chosen instead

I still have to look further into how successor nodes are generated and how the node's penalties are calculated accordingly.
In particular:

  • How are successor nodes computed
  • How are the penalties calculated
  • Elevation differences
  • Trapdoor interactions and other special cases

Testing

For the A* algorithm in general:

  • h(n) bias it towards getting closer to the goal by euclidean distance even at the cost of optimality. For this, we can setup this kind of obstacle:
 +---+---+---+---+---+---+---+---+---+---+
 | | | | | | T | | | | | S - start
 +---+---+---+---+---+---+---+---+---+---+ T - target
 | | | | | | | | | | | X - obstacles
 +---+---+---+---+---+---+---+---+---+---+
 | | X | X | X | X | X | X | | | | Going around the left costs 3 + 7sqrt(2)
 +---+---+---+---+---+---+---+---+---+---+ Going around the right costs 5 + 5sqrt(2)
 | | | | | | | X | | | | 
 +---+---+---+---+---+---+---+---+---+---+ But the game uses the left path because the right path
 | | | | | | | X | | | | remained further from the goal initially so h(n) overestimated
 +---+---+---+---+---+---+---+---+---+---+ its overall cost too much compared to the left path where
 | | | | | | | X | | | | the mob can close the distance immediately.
 +---+---+---+---+---+---+---+---+---+---+
 | | | | | | | X | X | X | | (the exact setup may need some tweaking to get the values right)
 +---+---+---+---+---+---+---+---+---+---+ 
 | | | | | | S | | | | |
 +---+---+---+---+---+---+---+---+---+---+
  • The limit to the node evaluation, together with the fallback to the closest node by manhattan distance towards the target can cause the mob to take non-optimal path
 +---+---+---+---+---+---+---+---+---+
 | | | | | T | | | | | Imagine this is zoomed out and/or the mob's follow_range
 +---+---+---+---+---+---+---+---+---+ attribute is modified (e.g. /data command) to a sufficiently
 | | O | O | O | | 2 | 2 | 2 | | small value.
 +---+---+---+---+---+---+---+---+---+
 | O | X | X | X | X | X | X | X | 2 | Then if the pathfinding attempt reached node evaluation limits
 +---+---+---+---+---+---+---+---+---+ before getting all the way left/right of the obstacle, the node
 | | O | O | | 1 | 2 | 2 | 2 | | straight across gets picked instead because it is closest to the
 +---+---+---+---+---+---+---+---+---+ target by manhattan distance (path indicated by 1).
 | | | | O | 1 | | | | |
 +---+---+---+---+---+---+---+---+---+ Then from this point, the algorithm may now have enough evaluation budget
 | | | | | S | | | | | to cross over the obstacle at the next attempt and eventually get to the goal.
 +---+---+---+---+---+---+---+---+---+ And if the detour is still too large, the mob will simply be stuck.
 
 Here, 1 and 2 indicate the path the mob takes over 2 separate pathfinding attempts
 with the 1st path falling back to the closest node by manhattan distance,
 resulting in a suboptimal path overall when taking the diagonal from the get-go
 is optimal (path O).
  • I also need further testing after looking into the nodes calculation as well.

Properties

  • h(n) is inadmissible, so optimal path is not guaranteed (even if follow range is large enough to fully evaluate all the necessary nodes).
  • Evaluation limit + closest node fallback meant:
    • Path that takes more than 1 pathfinding attempt may not follow the overall optimal path (h(n) permitting).
    • Mobs can get stuck perpetually given large enough detour/concave (depends on follow range).

I'm only familiar with the java edition and the corresponding source code. I believe these level of detail can vary wildly between java and bedrock, so I don't know how this should be treated.

WaterGenie3 (talk) 00:01, 4 August 2025 (UTC)

Agree, but I have a question. Would it be appropriate to use Microsoft Copilot to help determine, say, which mobs have “brain” AI and which ones rely solely on “goal” AI? DKRap064 (talk) 00:10, 28 September 2025 (UTC)
Most IDEs should already be able to list out which part of the code references another part of the code.
On vscode, this is "find all references" in the context menu.
For example, there's villager, piglin/brute, hoglin/zoglin, allay, frog/tadpole, axolotl, goat, sniffer, armadillo, camel, warden, creaking, breeze, and happy ghast using the brain system in some way.
---
AIs like copilot is a tool like anything else and we have to be aware of its capacity and limitations.
These are mostly LLM (large "language" model) under the hood. I think of them as someone who can read/write English well and is very fast with it, but they don't have strict/precise logic so that's where we should step in.
If we ask them to summarise a piece of code, we might get a very rough understanding, it might make incorrect assumptions here and there, it might not dig deep enough into the code to fully understand all the details. So we should always do our own checking.
WaterGenie3 (talk) 06:36, 29 September 2025 (UTC)
Thank you. DKRap064 (talk) 13:04, 29 September 2025 (UTC)
Is it possible that we could add a list of actions and properties that fall under “Brain” AI, like the article has for “Goal” AI? I’m not very good at understanding the code. DKRap064 (talk) 13:13, 29 September 2025 (UTC)
Yes, but these will all be about java only and we should assume that things are going to be very different on bedrock at this level of detail.
In the end, I think it'd be more like how the Mob spawning page was structured; with java and bedrock clearly separated with their own subsections. Unless there's already a standard for this on the wiki.
I don't know too much about brain/goal yet and I wanted to look into pathfinding first, so I can't do this alone.
WaterGenie3 (talk) 01:06, 30 September 2025 (UTC)
Well, I think I can partially help with pathfinding. At least on Bedrock, Villagers don’t try to path around Soul Fire (they do path around Soul Campfires). I’ll check to see if that’s the same with other mobs, but I’m betting it is. Piglins, of course, will probably be an exception, since they’re afraid of Soul Fire. DKRap064 (talk) 02:17, 30 September 2025 (UTC)

What is the list of goals?

[edit source]
Latest comment: 8 February1 comment1 person in discussion

Formally, what is mob AI § List of goals?

I was thinking it might be the list of classes in goal. But no, besides having classes there that aren't in the list, there are elements in the list that I can't find in the class... At the same time, not with the name that's in the list. Aloi4 (talk) 07:05, 8 February 2026 (UTC)

Retrieved from "https://minecraft.wiki/w/Talk:Mob_AI?oldid=3427696"

Navigation menu