Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Villagers attempting to pathfind through walls

Open luddebjorken opened this issue 11 months ago • 7 comments

Expected behavior

  • Villagers pathfind correctly to beds and workstations according to their schedule, going through doors to get into houses.

Observed/Actual behavior

  • Villagers attempt to access bed/workstation through the wall instead of walking inside the building, if the bed/workstation is close enough to a wall

Steps/models to reproduce

  • Construct a small box/house with an opening on one end
  • Place bed inside the box adjacent to one of it's walls opposite the opening
  • Spawn villager outside the wall on the side with the bed
  • Set time to night
  • Observe villager pathing

Plugin and Datapack List

None

Paper version

[23:50:10 INFO]: Checking version, please wait... [23:50:10 INFO]: This server is running Paper version 1.21.4-131-main@1004374 (2025-01-28T21:51:56Z) (Implementing API version 1.21.4-R0.1-SNAPSHOT)

Other

Might not replicate 100%. Making walls >4 blocks thick sometimes fixes the issue.

Tested same world on vanilla server with no issues.

luddebjorken avatar Jan 28 '25 22:01 luddebjorken

This seems to be a vanilla issue, https://bugs.mojang.com/browse/MC-160582. I can also reproduce the villager using the bed through a 1 block thick wall, just like in the vanilla issue.

Unsure if it makes sense to fix this on Paper, messing with mob AI usually upsets the people who expect some level of vanilla parity. Although a config option might work here.

Malfrador avatar Feb 02 '25 17:02 Malfrador

+1 for at least having it as an option. I spend far too much time trying to convince villagers they can't walk through walls lol

pixelatedmirror avatar Mar 25 '25 00:03 pixelatedmirror

Not an vanilla issue. Tested on vanilla 1.24.1, purpur 1.21.4, paper 1.21.4 and spigot 1.21.4 with same world. Works perfectly on Spigot and Vanilla, can't find their beds on Paper & Purpur

All server .jars are latest builds at the current moment

kotaru34 avatar Mar 26 '25 12:03 kotaru34

I spotted this recently on PaperMC (somewhere in 1.21.4 builds), but looking at the bug report on Mojang site, it was a thing in 1.21.2 (down to 1.14), and seems to still be the case from one occurence I got in Vanilla 1.21.5.

Somehow, it seems exacerbated within Paper (it happen way more often) + villagers forget to close the door sometimes (which is quite tricky at night, for them 🤣 ).

So yeah, if an option to "fix" that was possible inside Paper, it would be nice in my opinion (as Mojang isn't quick in fixing it itself).

Athar42 avatar May 20 '25 21:05 Athar42

We have started a new PaperMC server moved from a vanilla server and indeed villagers are kinda broken now. Sometimes they just don´t find nearby beds or get stuck in novel ways even though they managed to perfectly find beds/stations in the vanilla instance.

jdollinger-bit avatar May 26 '25 14:05 jdollinger-bit

Still happening on 1.21.6 build 9.

TauCu avatar Jun 18 '25 08:06 TauCu

Still happening on 1.21.6 build 9.

Just use smth else instead of paper/purpur

kotaru34 avatar Jun 18 '25 08:06 kotaru34

Can confirm now that it seems to happen a lot more often on Paper.

I also did some further testing with the Moonrise client mod in singleplayer to rule out its collision optimisation patches. No issue with just Moonrise, so that must be caused by something else.

Malfrador avatar Jul 03 '25 03:07 Malfrador

I've done some testing on CraftBukkit, Spigot and Paper. I built a paper jar with all* patches deleted. (except 32 because of compile errors, that patch has nothing to do with entities anyway)

This issue only affects paper (even paper with the aforementioned patches removed) It's very reproducible.

They can also teleport through walls to sleep in beds when they get pushed into said wall. Definitely something fishy going on with villagers on Paper. https://imgur.com/a/ehkicPX

TauCu avatar Jul 03 '25 06:07 TauCu