Please teleport lost villagers if not observed by player
ell1e opened this issue ยท 1 comments
Is your feature request related to a problem? Please describe.
I have a problem that gradually, all my villagers disappear or show up in absurd places. Part of this seems to be they wander off into another village part and then never return to their home only to wander further and further each day, getting to more absurd and more dangerous places until something bugs out. They don't seem to be dead or the tombstones aren't working, but in any case, it seems to usually be preceded by them spamming chat with them being lost and not finding home. This seems to be made worse by none of my villagers finding home again at night if they are just 2-3 house lengths away from their home, even if there is an obvious path. I understand path finding is never perfect, so I think there should be another solution for this to avoid them getting so easily permanently lost and eventually bugged out or killed. I'm seeing this on Minecraft 1.20.1.
Describe the solution you'd like
When a villager can't find home, instead of complaining via a chat message the villager should first check if they are seen by any human player from relatively up close. If that's not the case, they should simply silently teleport to their home.
Describe alternatives you've considered
An alternative would be to fix the path finding issues, but with a game as complex and as evolving as Minecraft that seems like it would never quite 100% work out.
Additional context
It seems to be a commonly reported issue by MCA players that villagers gradually disappear. Therefore, some pragmatic and reliable solutions like such a teleport hack that could reduce this problem would be nice.
I know exactly what you're describing here. And i have done some testing before. I can say with almost 100% certainty, that this is caused by pathfinding issues.
The message "i think i'm lost. I can't find the way home" only seems to play when you destroy a villager's bed, because the game doesn't recognize that the bed is no longer there, and the villagers assume that their bed must just be obstructed or something. I've also seen it happen that after being resurrected, sometimes villagers forget the location of their bed. And i assume that this must be a bug.
And most importantly, what you're describing, happens because the pathfinding gets bugged and the villagers fail to locate their bed. Even if you didn't break their bed or resurrected them. It's just a bug with the pathfinding.
Another thing i've noticed, is that villagers cannot find their beds, if they're either directly bellow or above them, unless there is a very nearby path. It seems like unless there is a path in a small radius around the villager, it won't be able to find it's bed.
But i think a lot of it, is Minecraft villager code, which is a mess and half assed at best. So, it may be hard for MCA devs to do much about the pathfinding. I agree that villagers should just teleport when they find their pathfinding obstructed.