Updated description by @unknown
Steps to reproduce
Place a bed and workstation.
Fully enclose the bed and workstation in opaque blocks.
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:
A villager can only discover POI blocks that are within 16 blocks horizontally and 4 blocks vertically of their position.
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.
If a POI block is broken, all the village dwellers instantly know about it and forget the block.
Any villager can claim any POI blocks that isn't already owned, regardless of which villager discovered it initially.
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.
Linked issues
is duplicated by 38
relates to 4
Attachments
Comments 19
@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.
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).
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.
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.
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.
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]
Accessibility has no impact on connecting to POI (beds, workstations). Only distance within built-in detection range matters.