mojira.dev
MCPE-42912

Villagers cannot pathfind around walls to their beds

When a villager (v2) tries to go to bed, it can happen that it approaches its claimed bed from the other side of a wall. When this happens, it appears to pathfind through the wall. When it can't reach it, it displays anger particles and wanders for a short time. Sometimes as it wanders it displays green particles as if it discovered the bed again, and sometimes it doesn't, but in either case it can get into a loop trying repeatedly to pathfind through the wall. I have also seen this happen after the villager gets up: It tried to pathfind to its workplace through the wall.

I have attached a test world. To reproduce the problem, simply observe the sole villager for a while.

Linked issues

MCPE-186972 Villagers can't get to their bed Resolved MCPE-217158 Villagers Workbenches Bug Resolved MCPE-183723 Villagers have huge problems reaching their beds and workstations. Resolved MCPE-178361 Villagers no longer pathfind to beds etc Resolved MCPE-174682 Villager job and bed path finding Resolved

Attachments

Comments 41

Sometimes I see a villager who is "try" to walk towards a bed even though there was a villager sleeping in it's bed and the villager (who tries to walk towards an occupied bed) tries to "push" the sleeping villager. Does this happen to you as well?

@Dylan Zosimo: That may be normal behavior. From what I've seen so far, in certain situations a villager can lose ownership of its bed while it's sleeping. Since the second villager doesn't have a bed yet, it claims the bed and tries to lie down, but the first villager is still in it.

I have Noticed this too. Villagers try to pathfind through walls instead of opening the doors and going inside to sleep. Also if it is raining at night they will not sleep at all. Im on Android Samsung galaxy tab A 2017

What I've found in 1.11.0.9 is that if the door they need to go through is within about 5 or 6 blocks of the straight line path from the villager to its bed or job site block, the villager will find the path through the door. Otherwise, they try to walk through the wall and get frustrated. After getting frustrated 3 times, they relinquish the bed or block and search for a replacement, which usually means they find the same bed or block again and the whole cycle repeats until they happen to wander closer to the door.

@unknown: The issue with sleeping when it's raining should be reported separately. It's caused by the fact that when it's raining, most villagers will go inside the first building they come across, even if it's not where their bed is. Then when it's time for bed they're stuck there because they can't use a door while it's raining. Although that's by design, I'm not sure the consequences for sleeping were noticed, so it might be considered a bug.

Still happening in 1.12. Door will be 5 blocks to the side of where the villagers are standing, trying to go through the wall instead of pathing inside.

31 more comments

This is really bad

image_2025-05-24_003614779.png

Admittedly, i am no dev, but it seems to me that if you can make it work in java then surely it can’t be that hard in… whatever language bedrock is written in? but i don’t really know.

Seeing the same problem, they don’t path to beds or work site block.

In some instances, when going to sleep, a villager pops through the wall if it is in a spot near a bed when the blocks are diagonal to each other and not side to side from one another.

I think I've determined what causes this problem, at least in some cases. A villager can only jump up by a height of 1 block. Normally, if there is a stair in front of the door they need to pass through, they can climb the stair and go through the door. But if there is mud, farmland, or dirt path surrounding the stair, they can’t jump onto the stair because these blocks are only 7/8 of a block high, meaning they would have to jump 1/8+1 blocks to the top of the stair. Since they can’t jump up that far, they don’t recognize the path through the door as a walkable path, and instead they move as close as they can get to their bed, which is on the other side of the wall from it.

The solution is to replace the short blocks around the stair with full height blocks such as dirt or stone bricks. I have fixed all of my problem villagers by doing this.

As an aside, I have found that replacing dirt paths with full height blocks also improves villagers' ability to pathfind to their beds or workstations even when they don’t have to jump up to get there. I’m not sure but it might be enough to replace just the block or blocks next to the workstation or door. This seemed to solve a problem with villagers having to make several attempts to find their beds.

Auldrick

(Unassigned)

305639, 204502

Confirmed

Multiple

1803

1.20.10.21 Preview, 1.19.70.26 Preview, 1.14.20 Hotfix, 1.11.0.3 Beta, 1.11.0.5 Beta, ..., 1.21.50, 1.21.60.24 Preview, 1.21.51 Hotfix, 1.21.72 Hotfix, 1.21.80

Retrieved