After building a structure with multiple floors, i decided to populate it with villagers. This "village" is structured in this way: the ground floor has job site blocks while the first floor above has rooms with beds, like a condominium.
At first it looked like it was working as intended but then i noticed villagers started "acting wild": it happened when the villager's position in the ground floor tried to reach a bed right above him but even with a path up there avaiable, the villager wouldn't take the avaiable path and would get right below the bed instead. Only if there were few blocks away from the bed then the villager would reach the bed. Same happens viceversa, if villager is above and job site is right below.
If i got it right, pathfinding for villagers (or mobs in general?) gets wild when the villagers try to reach higher objectives and the path towards the latter is longer than expected by the AI's pathfinder: in this case, it's a villager "seeing" a bed above him and "trying" to reach it from below in order to "not take the longer path" but not succeeding. More technically, the pathfinder "prefers" the shorter path (that doesn't exist because there is no way to go up) because it can't detect the longer one.
This was a bummer for me because i really expected villagers taking the stairway towards their objectives instead of seeing them hanging over the area where the bed is placed right above. Is there a way to fix this problem, and thus making "multiplane" pathfinding more functional?
Attachments are uploaded, showing how the villager behaves when he detects a bed nearby but the path to the bed avaiable is long.
(irrelevant info for visitors but i feel like i need to point it out: i made the "end gateway" there, was messing with command block teleportations).
Linked issues
is duplicated by
Attachments
Comments

I checked right now, it still does. And also, even if that might be clear, if there are blocks below the objective, the mob will try to get on the former because it's the nearest place where one entity can stand to the latter. Pretty amusing but still a kind of bummer for me.
Same for me 1.16.201
Temp fix; Double your outside walls that beds touch. You can do so with barrier blocks so you keep the buildings original look. Villagers wonβt attempt to pathfind through doubled walls and will eventually find their beds once again.
also put barrier blocks 2 high around the building to eliminate inner corners.
do not put any barrier blocks in front of doors.
I am unable to reproduce this issue in 21w19a. Villagers seemed to have no problems when pathfinding to a bed. Their behaviour seemed normal and no issues were apparent.
>I am unable to reproduce this issue in 21w19a. Villagers seemed to have no problems when pathfinding to a bed. Their behaviour seemed normal and no issues were apparent.
This is completely incorrect. It's a lot of time i didn't play Minecraft and i'm not playing snapshots right now either, but i just tested right now with the same setup i showed in the screenshots, and the issue is still the same even inΒ 21w19a. This was not fixed.
In that case, please provide a video that demonstrates this issue.

We do not have enough information to find the cause of this issue.
Please attach the affected (zipped) world file. If the file size is too large, please upload it somewhere else and then link to it here.
This issue is being temporarily closed as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
π Bug Tracker Guidelines β π¬ Community Support β π§ Mojang Support
π Project Summary β βοΈ Feedback and Suggestions β π Game Wiki
Hello. Sorry for the very late reply but i didn't have the occasion of dedicating time to this problem. In any case, i have just uploaded villager_issue.zip that contains a video footage illustrating the issue. I hope it is enough.
And by the way, i recorded the video in 1.17.1.

Please provide the world file for testing. Thank you.
Here's the world file.Β It works on 1.17.1, since it won't work in the latest snapshot.

I was unable to reproduce in 21w41a with the world provided the villager went to the bed at the closest available rout
Please check if this is still an issue for you in 1.16 Release Candidate 1 or later.