
there is a some kind of cave and a village spawned in it. i liked there really much and started to live here. but mobs (iron golem, sheeps, villagers) keep climbing upwards. villagers' bed are down in the cave, there is no dark areas which means there is no mobs that can scare them. also iron golem and sheeps keep doing it. why? how can i solve that?
by BirGunOlecek
5 Comments
Mob pathing can select blocks that are buried, which corrects itself to the topmost reachable block, so higher, filled in areas attract mobs over time. There are a lot of videos on YouTube that go into detail.
mob AI broken lol
Note: Java , pc.
Mob pathfinding.
This video explains it well. https://youtu.be/HXTr6DpPYqs?si=S257UpoHSh17Z5zB
There’s a really good video of it out there, but it’s selection bias.
Long story short, mobs will randomly pick a target non-air non-water block within a pathing reach.
If the block has enough space above it, they will try to go to it.
If the block doesn’t have enough space above it, they will go to the top of that stack.
For example, say we have 2 pillars that they can choose between. One is 12 blocks tall, 1 is 1 block tall. For this example, only these 13 blocks are avaialble for their pathing selection.
They have a 12/13 chance of selecting a block in the stack, and a 1/13 chance of selecting the single block.
Expand this to real terrain, and they will overall prefer to go to taller columns.
And yes, you can discourage pathing areas by removing blocks underneath them.