What I expected to happen was...:
Villager goes through the door and sleeps in the claimed bed.
What actually happened was...:
Villager is stuck in the permanent loop, going in and instantly back out through the door, cannot pathfind correctly to the claimed bed.
After exiting villager is going away from the door for a short distance (like 5-10 blocks), then goes back to the door, goes through it and instantly back out (when another entity is in front of the door, like iron golem, the villager often doesn't even go through, just opens and instantly closes the door), and the loop starts again.
Maybe useful notes:
Single and double doors are affected.
I tried to remove carpets as I know they can obstruct or cause some pathfinding issues, same for pressure plates, any not full blocks on the floor, ceiling, walls, or literally anything that can obstruct the bed.
Removing the doors instantly helps, so I figured something with them is causing the issue.
In some cases opening the door manually for the villager breaks the loop and he can go through it like normal.
After taking the screenshots I realised that I'm running fabric mods, so I checked the behaviour on the vanilla 1.19.2 version, it's exactly the same as described above.
I've attached some screenshots of the three setups experiencing this issue. I tried to show the view from the outside and inside, so investigating would be easier. (in the second set of screenshots the problematic room is the nr 9 room)
Steps to Reproduce:
1. Create a setup like on the attached screenshots.
2. Set in-game time to night.
3. Spawn the villager outside the room.
Thank you for your report!
However, this issue is Invalid.
Your game, launcher or server is modified.
If you can reproduce the issue in a vanilla environment, please recreate the issue.
Any non-standard client/server/launcher build needs to be taken up with the appropriate team, not Mojang.
Any plugin issues need to be addressed to the creator of the plugin or resource pack.
If you have problems on large servers like Hypixel, please contact them first as they run modified server software.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki