mojira.dev
MCPE-112609

Villagers can't pathfind across/through/over waterlogged blocks

Observed behavior:

Villagers cannot pathfind across/through/over waterlogged blocks.

 

Expected behavior:

Villagers should pathfind across/through/over waterlogged blocks, just like zombies or other mobs can.

 

Reproduction instructions:

  1. Create a room, 8x8 for example, with 2 high solid block walls

  2. Split the room down the middle one block deep

  3. Fill the one block gap with lower slabs

  4. Place a bed on one side of the room

  5. Spawn a villager on the other

  6. Set the time to midnight

  7. See the village pathfind over the lower slabs to the bed.

  8. Kill the villager and set the time to noon

  9. Waterlog the slabbed gap

  10. Place a bed on one side of the room

  11. Spawn a villager on the other

  12. Set the time to midnight

  13. See the villager wander around their side of the room for a while until the storm cloud particles appear over the villager and bed.

  14. Rinse and repeat this whole procedure for upper slabs, lower trap doors, upper trap doors, and any other block that can be waterlogged.

Alternate reproduction instructions:

  1. Create a room, 8x8 for example, with 2 high solid block walls and a roof (so zombies don't burn)

  2. Split the room down the middle one block deep

  3. Fill the one block gap with lower slabs

  4. Make an exit on one side of the room

  5. On the non exit side of the room, spawn a villager and a zombie

  6. Watch the villager pathfind over the lower slabs to the room exit

  7. Kill the villager and zombie

  8. Waterlog the slabbed gap

  9. On the non exit side of the room, spawn a villager and a zombie

  10. Watch the villager be unable to escape the zombie (note: the zombie may hit the villager over the gap.  If that happens, ignore that test and repeat)

  11. Kill the villager and zombie

  12. Spawn a village on the non exit side of the room and a zombie on the other.

  13. Watch the zombie pathfind over the waterlogged gap and get the villager.

  14. Rinse and repeat the whole procedure for upper slabs, lower trap doors, upper trap doors, and any other block that can be waterlogged.

I realize there are other villager pathfinding bugs in the tracker but non of the tickets marked with the current available "affected version" tags describe this behavior in particular.  This seems like this issue is related to the resolution of MCPE-47075  as that issue closely resembles this one.

Linked issues

Comments 3

Affects Nintendo Switch as well

This is very different from MCPE-37005. There the issue is mobs getting stuck inside blocks, and it only applies to small mobs. Villagers have no problem moving out of a waterlogged block.

The problem here is that villagers will not choose a path across any kind of water unless they are already in water. This applies to both flowing and source water as well as to waterlogged and flow-logged blocks.

I would guess the bug is in navigation.walk checking both block layers instead of just the main block layer. Water in the second block layer (i.e. for waterlogged blocks) should not be checked for walking navigation at all because it is sufficient to check whether the block in the primary layer is navigable. Pathmaking should just fail for seagrass and kelp the same way it does for flowers, and succeed for slabs regardless of if they are wet.

OverWatch

(Unassigned)

560262

Confirmed

Windows

ai, pathfinding, villager, water, waterlogged-blocks

1.16.201 Hotfix, 1.17.2 Hotfix, 1.18.30

Retrieved