mojira.dev
MCPE-50441

Villagers detecting beds and workstations they can't reach

Updated description by @unknown

Steps to reproduce

  1. Place a bed and workstation.

  2. Fully enclose the bed and workstation in opaque blocks.

  3. Spawn a villager.

Expected result

The villager does not link to the bed and workstation.

Actual result

The villager links to the bed and workstation, even though he can neither see them nor pathfind to them.


Original description

Very similar to MC-155238 I have a village behind my house, blocked in by fences/gates, the villagers are detecting my workstations through the walls and also my bed, which is a floor up and involves a spiral staircase made of slabs. Seems the villagers are not using a pathfinding algorythm but are instead just going off raw distance

Workaround by @Auldrick

You can easily work around the specific problem of villagers claiming beds and workstations you don't want them to by placing them where a villager can't detect them.

First, you need to slightly adjust how you think about villagers detecting POI blocks (beds and workstations for our purposes). Without going down the technical rabbit hole, think of it as follows:

  1. A villager can only discover POI blocks that are within 16 blocks horizontally and 4 blocks vertically of their position.

  2. When a villager discovers a POI block, it immediately communicates the kind and position of the block to all the other dwellers in its village.

  3. If a POI block is broken, all the village dwellers instantly know about it and forget the block.

  4. Any villager can claim any POI blocks that isn't already owned, regardless of which villager discovered it initially.

  5. The block has to be rediscovered by one of the villagers every few minutes (the exact time is unknown or unpredictable) or it will be forgotten.

Given the above rules, it's easy to see that all you have to do is keep your personal POI blocks at least 16 blocks horizontally and/or 4 blocks vertically away from anywhere a villager might stand. Ways to keep the villagers away might include:

  • Placing your blocks on a hill or in a valley where they can't pathfind to (but make sure there are no hills or caves they can get to that could get them in range).

  • Building a defensive wall or fence around the village, then subdividing it with another fence or wall to make yourself an enclave. Make sure your blocks are at least 16 blocks from the dividing fence.

  • Dig a hole about 7 blocks below the lowest point in the village and build your mini-base in it. Make sure there are no caves around that villagers could get into.

If an accident happens and your POI blocks are discovered, just fix the problem that let the villagers get too close, get them back where they belong, and then break the POI blocks and replace them.

Related issues

MCPE-47519 Villager Professions. Not Visual? MCPE-57166 Villager job site issues MCPE-59149 Villager POI Selection/Switching not honoring Valid Path MCPE-60525 Villager detecting workstations through walls MCPE-62186 Villagers broken MCPE-67760 DUPLICATE!!!!!!!!!!! IDK HOW TO DELETE IN JIRA. THE UI IS SO UNINTUITIVE. MCPE-76397 Villagers are able to change their profession without being in direct contact with workbenches. This has caused many problems because my house is in a village. MCPE-81777 Villagers lock onto player beds that they can't pathfind to and will not sleep in the beds next to their workstations. MCPE-111051 Villagers pathfinding workstations MCPE-112909 villagers can connect to beds for absurd distances MCPE-117677 Villager take block of profession if it stands above them or behind the wall MCPE-118411 Villagers will claim job site blocks that are otherwise unreachable. MCPE-119196 Villagers detecting workbenches from too far MCPE-122603 Villagers *Big Bug* MCPE-129678 Parity issue: Villagers don't reach their workstation before claiming MCPE-133529 Villagers will claim a workbench that they can't pathfind to, including changing the specific work bench every time you relog, resulting in the majority of the villagers in a trading hall unable to refill their trades. MCPE-137665 Villagers can link to work stations though blocks MCPE-139121 Villagers will randomly choose a job block they cant pathfind to, MCPE-140283 Villager path finding problems MCPE-143501 The Villagers sees through the walls MCPE-145436 Villager professions are broken and will path find professions through blocks, glass and closed fence gates MCPE-148680 Villagers claiming workstations that they can't see or accses MCPE-151791 Villagers getting a job without touching the workbench. MCPE-151996 Villager link to workstation they are unable to pathfind to. MCPE-152812 villager can link to workstations behind a block MCPE-153938 Villagers Take Job Despite Being Many Blocks Away From Job Block MCPE-166824 Villagers take worktables and beds too far away from them MCPE-167426 Villagers see through the ground! MCPE-168776 Villagers can claim beds/workstations despite if they are reachable or not MCPE-171241 Villager Path Finding MCPE-172651 villager does not take the nearest profession. MCPE-173900 Villagers professioning more than 20 blocks away MCPE-174437 Villager Job Finding not working MCPE-179220 Villager Problem MCPE-184734 I've encountered issues with Minecraft Bedrock villagers' AI. They can't pathfind correctly REALMS-8095 villager linking issues REALMS-11719 Villagers Broken After 1.20 MCPE-217177 Villagers taking inaccesible job blocks.

Attachments

Comments

migrated
[media][media][media][media][media]
[Mod] Umija5895M

Accessibility has no impact on connecting to POI (beds, workstations). Only distance within built-in detection range matters.

migrated

@Umija5895M - You keep repeating that and you are completely wrong. Accessibility is a significant requirement as is evident in Java where these features work correctly. Range is secondary to accessibility.

https://minecraft.gamepedia.com/Villager#Job_site_blocks

"A job site block can be detected as long as it is in range, not already claimed and the villager can pathfind to the block to claim it."

Last I checked a job site that is within range can be picked even if the villager cannot pathfind to it. It also doesn't care if another Villager has chosen that job site. The same issue exists with beds.

[Mod] Umija5895M

I'm not arguing that accessibility is not a desirable feature as it certainly is. However, just because the feature works a particular way in Java doesn't mean that it is intended to, or will ever, work that way in bedrock (unfortunately, most of the time). That would be a "parity request" and is consider invalid for the bug tracker. I have also been told by moderators that the wiki is not an "official reference" to how it is supposed to behave.

I was merely pointing out how linking to POI's currently works in bedrock. It is not for me to decide whether this is actually how it is intended to work, and since this bug report has been "confirmed", we can hope that the intent is to have accessibility to workstations and beds matter (even though that will "break" some popular iron farm builds).

[Mojang] Mega_Spud (Jay)

Please include more information including steps to reproduce the problem:

Steps to Reproduce:
1.
2.
3.

Observed Results:

Expected Results:

Also, a simple .mcworld test world that showcases the issue would be useful.

GoldenHelmet

Test world uploaded,

[media]

The world consists of a small enclosure with 3 beds and 3 workstations, a dispenser and command blocks. The dispenser is filled with villager spawn eggs. 1 bed and 1 workstation are accessible to villagers through doors; 2 beds and 2 workstations are fully enclosed in solid walls and not accessible. The command blocks can be used to quickly change to morning and evening, and to kill villagers to reset the test.

To run the test, press the button on the dispenser to spawn villagers. The villagers will be just as likely to claim the inaccessible beds and workstations as the accessible ones.

migrated

Affects 1.16.100

Affects 1.16.200.56 Beta

migrated

Affects 1.16.201

migrated

I have yet to discover any range limit besides render distance. My villagers don’t care how far away the work stations are.

mono832

I've noticed this too. its really bad because then they cant refresh there trades cause they lock to a station that they cant reach

Auldrick

Please remember that the bug tracker is not a discussion site. Comments here should provide additional information that will help the developers find and fix the bug. Other uses are subject to removal because they make it harder to find the information the developers need. For discussion, please use the Minecraft Discord.

(We also usually allow sharing of workarounds, but village functioning is such a complex topic that it would take far too much text in this case.)

Auldrick

@unknown: I think you're basing that suggestion on the belief that this will be treated as a parity issue, but I have doubts that Mojang is going to handle it quite like you expect. The village mechanics in Bedrock are quite different from Java's, and I think that's because it has to be to fit the game onto a mobile platform. So I was frankly surprised that Mojang even accepted this bug report instead of closing it as Working As Intended,.

I reckon the reason they accepted it is as a focal point for discussing ways to mitigate the user experience problem rather than to duplicate Java mechanics. That will include discussing not only how they might change the behavior to be less troublesome, but also how much effort it would take them to implement such a change and whether the effort is justified compared to any workarounds available to a player.

Speaking of which, this makes me realize that there is a workaround for this problem, one that I use myself all the time. It just didn't occur to me to write it up until now. Since it's not specific to your comment, I'll add it to the description above a few minutes from now.

migrated

This workaround only works if your goal is to get you villagers not to attach to POIs period. As someone who works heavily with villagers, I need them to connect to specific POIs; this is near-impossible when villagers over 100 blocks away want are prioritized over the villager literally touching it.

Auldrick

@unknown: The behavior you're talking about isn't related to the bug in this ticket. However, I can tell you that there are ways to solve your problem, not by modifying villager mechanics but by understanding how their designed mechanics work well enough to exploit their current behavior. (It is a little harder to do with a large village, though. You might want to shrink the village if you can.)

Unfortunately, the bug tracker isn't the place to discuss this. There are plenty of technical people and server communities who have this knowledge and will share it. Try asking about them at the Minecraft Discord. You could also check out some technical YouTubers' channels, as many have addressed this specific problem in their tutorials on building trading halls or even iron farms. Two I can recommend are Old Guy and SilentWisperer. Good luck!

Auldrick

Reminder: This is not a discussion forum. Comments are for providing additional information to the developers that might help them find and fix the problem. Other comments are off topic and subject to removal.

migrated

Bed placement is not 16x16 square in the below test FYI. Came up as 16, 16, 15, 15.

 

I placed a villager at 70, 4, -70. I then marked out 5 block spaces from there ( villagers at base 0). 2 of the 4 sides only reach 15 spaces whereas the other two sides reached 16 spaces.

[media]

Reply from @unknown:
I think the reason you're seeing those results is that you're counting blocks rather than measuring distance. The block space the bed is in is not the center of the square, because the center of a square is a point, not a block space. If you instead measure from the northwest corner of that block space, I think you'll measure it as 16, 16, 16, 16. Edit: This also implies that the glowstone blocks on the left and top sides are inside the square, while those on the right and bottom are in the adjacent squares.

migrated

Sorry, not sure how to reply to your post.  But I think I understand it now. Thanks for your help! For others who run into this, maybe this will help.

[media]
migrated

can confirm for 1.19?

Minecraft386882

Confirmed in 1.21.44

migrated

this is not a work around.

why is it that in java villagers will only claim bed and blocks that they can actually reach, but this so called work around.... so villagers are broken in bedrock then.

also, villagers are detecting bed and blocks withing 16 chunks or something, not 16 blocks

migrated

(Unassigned)

318266

Confirmed

Multiple

Windows 10

java-parity

1.19.80.21 Preview, 1.18.20.21 Beta, 1.17.30.23 Beta, 1.17.11 Hotfix, 1.17.10, ..., 1.20.62 Hotfix, 1.20.81 Hotfix, 1.21.2 Hotfix, 1.21.44 Hotfix, 1.21.72 Hotfix

Retrieved