mojira.dev
MCPE-62186

Villagers broken

Villagers are taking professions and beds they can't pathfind to... I have a Library that is like 50+blocks above the ground, with lecterns and villagers bellow the library are taking the proffesion and beds above... so that causes that the villagers that can pathfind to the work stations, are not able to get the proffession...

 

This is something really dumb... villagers should only take professions or beds, if they are able to pathfind to them.  And also the villagers that are the closest to the work station should have privilige on taking the proffession / bed.  

 

Related issues

Comments

Auldrick

Thank you for your report!
However, this issue is Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit Minecraft Suggestions on Reddit or visit the Feedback website.

Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki

migrated

No it is not a feature request or suggestion... the bug is the one that I said..

Villagers taking professions 50+ blocks away from them, even when they can't pathfind to them...

That is not even a feature... it is the intended behavior according to the wiki.

Auldrick

The wiki is not an authority on intended behavior. Only Mojang is, and Mojang has said that it isn't intended to work the same way in Bedrock.

Here's how it works in Bedrock: Conceptually, the game maintains a list of villagers needing beds and/or workstations, a list of unclaimed beds, and a list of unclaimed workstations. If the first villager needs a bed, it will claim the first one in the bed list. If it needs a workstation, it will claim the first one in the workstation list. After that, the game moves on to the next villager and the process repeats.

The game doesn't attempt to keep these lists in any particular order, so which villager claims which bed or workstation is essentially random. That sounds inefficient, and it is from the player's point of view, but it's actually more efficient from a processing point of view, and I imagine that's why the Bedrock team does it this way.

To compensate for villagers claiming blocks they can't reach, there is additional logic you probably haven't noticed: If a villager is trying to get to its bed or workstation and it can't find a path, it first emits anger particles. Then it wanders for a moment and tries again. If it still can't find a path, it emits the particles, wanders, and tries a third time. If it fails on the third attempt, it gives up the bed or workstation (which emits anger particles) and goes back on the list to claim another one. As long as the villagers are free to wander around and the lists are in random order, this should eventually result in the villager claiming a bed or workstation that it actually can reach. (Well, theoretically...but in reality it's not always successful because sometimes the villager just winds up claiming the same bed or workstation again and again.)

The problem you're having occurs because the villager isn't free to wander until it finds a block it can reach and claim it. Most farm designs confine villagers to keep their associations with beds and workstations stable once they've been established, but the problem is that confining them makes establishing those associations much harder with the logic as it currently exists. That logic is adequate in naturally generated villages, it just doesn't work too well in farms where the villagers aren't in their natural environment. Mojang didn't plan for it to work under such conditions, because Mojang doesn't build farms into the game. (Note that I'm not saying Mojang doesn't like farms or tries to make them break, because they don't. In fact, they frequently make code changes specifically to make some kinds of farms work better. What I'm saying is that there weren't any farms using V2 villagers at the time this logic was being designed, so they obviously couldn't predict how those farms would work and craft their algorithms to support them.)

I can think of two ways to solve this problem. One is for Mojang to change the logic of how villagers find and claim beds and workstations so it works better for confined villagers. Your suggestion to have them claim the closest one is one possibility, and it would solve the problem for your farm, but it isn't a general solution for every farm because you could end up with most of the villagers succeeding and then the last few workstations are all too far away from the last villagers. Your solution depends on you carefully placing workstations next to the villagers you want to have them, but other people's farms might be designed on different principles and it wouldn't necessarily work for them. However, Mojang might consider your distance-based solution a reasonable way to solve the problem, or at least a better one than the current algorithm, and that's why I labeled your solution as something you might want to suggest on the feedback site.

The other way to solve this problem requires a little bit more discipline, but it will work with the current algorithm and with virtually any farm design. The problem is essentially that you don't control which villager claims which workstation. But in reality, you can control this. All you have to do is ensure that as you're setting up the farm, at any given time there is only one villager in the list of villagers needing beds and workstations, one bed in the list of available beds, and one workstation in the list of available workstations. You do this by introducing one villager, one bed, and one workstation at a time. The villager will immediately claim that bed and that workstation, because they're the only ones available, and after that the lists will all be empty again. So then you just repeat the process for your second villager, then your third, and so on. It doesn't need any change to your design, and doesn't even require any more effort than you're already doing, because you're still placing all the same blocks in the same positions, you're just doing it in a specific order and mingling the villagers into the process. (However, it does require keeping all the villagers well away from the farm until you're ready for them, one at a time, so there is some extra planning and villager wrangling involved.)

migrated

The library I made is gigantic, it is like 50x60 blocks, so they have enough space to move, and the problem also persists in the ground that is a zone of like 200x200 enougg space so that they can wander arround, I don't intend to have them as a farm

I understand your second solution, but the only way to do it, is by getting rid of all the villagers I have right now. But I think it is the easiest solution.

I said about the wiki, since you mentioned the wiki in your comment.

Is there a place I can look for game mechanics like the one you just explained to me?

Thanks for your response

Auldrick

The wiki is meant to be the place that describes this kind of game mechanics. That's Mojang's official position. However, Mojang doesn't take responsibility for doing the work of updating the wiki; they leave that to the community, who (in the case of Bedrock) can only find out through careful experimentation within the game. And that can take a horrendous about of effort. (All of what I described above was stuff I learned through hundreds of hours of experimentation. I should probably add it to the wiki, but I hold back because even now I'm not sure my description is exactly correct or complete, and also because writing it up in wiki form would take even more hours.)

You might wonder why Mojang doesn't at least publish their design documentation, so that we could use it to update the wiki and make it more complete and accurate. I can think of a bunch of reasons they wouldn't want to do that:

  • It would make it a lot easier for pirates to steal the design and write knockoff versions of Minecraft.

  • Mojang would paint themselves into a corner. When people see "official" documentation, they expect it to be permanent and unchanging. If Mojang later needs to change the design to accommodate new features, some people would complain that they shouldn't change something they've already published because it's "unfair" to users who depended on it.

  • Players see the game from a certain point of view, one that's described in terms of blocks, items, mobs, etc. The developers see it from a very different point of view that reflects the inner workings of the program. The design documentation is written for the developers, so it describes things in the inner, technical way. It would have to be translated into terms players understand before they could make sense of it, and that would be a very big job.

  • Technical people in the community who could understand the documentation would almost certainly look for ways to improve the game's design. That's not a bad thing in itself, but unfortunately those people only have their own limited ways of using the game, so ideas that seem brilliant and obvious to them aren't always good ideas for everybody who plays. Take, for example, your suggestion about villagers claiming the closest blocks. You didn't see how that might work badly for other players because you don't build the kinds of farms they build. It's extremely difficult to have a broad view of the full scope of how people play the game, and I think that's why Jeb insists on being the final arbiter of new features to be added. But back to the technical community: If Mojang published the design documentation, they'd probably have to spend a lot of time explaining to those people why their exciting ideas just aren't really a good idea in the long term. There would be arguments and hurt feelings, and it would just be a mess. Nobody wants that.

Auldrick

There have been improvements to villager pathfinding in recent months such that my comments above about this being the intended behavior may no longer be true, We need the developers to weigh in on whether the behavior described herein is intended or is the result of a bug. Normally we would handle that by reopening this ticket and forwarding it to them, but it turns out that a previous ticket that does so already exists, so this ticket will be re-resolved as a duplicate.

You may want to upvote and watch MCPE-50441 for developments.

migrated

(Unassigned)

Unconfirmed

PlayStation

1.14.1 Hotfix

Retrieved