Updated description by @unknown
Steps to reproduce
Spawn a villager
Place a bed and workstation and wait for the villager to link to each.
Trade with the villager to lock in its profession.
Place at least 32 workstations of a different type within the 32 x 32 area around the villager.
Break and replace the villager's workstation.
Expected result
The villager relinks to its workstation.
Actual result
The villager does not relink to its workstation.
Original summary
Using barrels causes villagers to lose links to their workstations
Original description
Summary: Trading hall with 17 villagers comprising:
9 Librarians
2 Farmers
1 Butcher
1 Fletcher
1 Fisherman
2 Shepherds
1 Cleric
Observation 1:
6 x Double chests contain items to trade are located very close to the villagers.
In this format, you can break any workstation, angry particles emit from villager, replace the workstation and the villager immediately links back to the workstation. This works on all librarians, shepherds and the fletcher so I assume it would for the others trades but this is untested as I have too many alternate workstations in my base (<42 blocks away) for them to link to and I refuse to spend needless time breaking/replacing workstations just for them to link to the one I want them to link to. So this is all hunky dory (kinda) and as the game should work.
Observation 2:
REPLACE 6 x Double chests with 12+BARRELS (to have discrete items in barrels instead of shared items in chests) and locate them close to the villagers
In this format, if you break any workstation, angry particles emit from villager, however, replacing the workstation does not cause the villager to immediately link back to the workstation. I have waited until the next day when they are supposed to refresh their trades and they still don't link and will not refresh their trades thus breaking the trading hall.
Solution or temporary fix as observed:
Breaking all the barrels (except the one for the fisherman) and replacing them with double chests seems to fix the linking back to the workstations for the trades where it is feasible to break and replace.
Thoughts: Perhaps because the barrel container is more "advanced" than a standard chest, requiring far more code because of villager interactions, etc - this may be causing too many instructions to be carried out over a given time frame or perhaps locks up something due to container scanning and by breaking the barrels and going back to chests frees the error....NOTE: all the barrels contained trading items, over 75% of them were almost full
Sorry for the essay, but I feel this error may be contributing to other villager trading bugs and hope this helps 🙂
EDIT: NOTE: 15 blocks away around the corner is a furnace array using 12 barrels and downstairs (say 25 blocks away diagonally) is a brewing array using 30 barrels and a cane farm using 4 barrels
Related issues
is duplicated by
Attachments
Comments


I am not able to reproduce this in 1.14.60, so it looks like a new beta bug, perhaps caused by the fix to MCPE-49580.
Does the same thing happen if you place other workstations than barrels? For example, if you break your fisherman’s barrel and place a bunch of lecterns, will your fisherman not re-link when you replace his barrel?

No I don't get a problem with other workstations and linking (not even with the librarians). I can break any one of the 9 lecturns, replace it - and the corresponding librarian will link straight back to it. It just seems to be the placing of too many barrels in the trading hall that affects the general linking to ANY workstation. As long as I haven't got a glitched gamesave, if I break the fisherman's barrel, they will just continue to link to one of the other 50+ or so barrels in my base away from the hall (see the EDIT note above), but in time they will link. What I actually do is break ALL 50+ barrels first and place the fisherman's barrel so they link up, then replace all the other 50 which is damn crazy. This is why there is only ONE fisherman in my base lol. Please also note that I haven't a clue as to why the other 50 barrels in my base don't affect the linking (they are 5+ lower on the Y coordinate), but placing say 10 more barrels within a few blocks of the villagers feet does??? I think the conflict of the player needing to use certain workstations (i.e. barrels for storage, grindstones for disenchanting, looms for banner creation, etc) alongside the mechanic of unemployed villagers wanting to naturally link to the players workstations is a recipe for disaster. and I'm hoping Bedrock gets the parity Java code (released in a recent snapshot) that will prevent villagers from linking to workstations they cant path-find to. But this is beyond here as this is for bug tracking not suggestions.

You can vote for MCPE-50441 on the linking to workstations they can't pathfind to. Also MCPE-43071 on the issue of seniority in linking, which was added in a recent Java snapshot.
I wonder if the issue is villages having a limit to how many workstations they can hold in a detected-but-not-linked list. I am going to try to test that.
Update: Yes, in 1.14.60 there is a limit of 32 unlinked workstations that a village can detect. However, this list is not saved permanently, it is remade every time you relog.

Thanks for the great detective work and clarification of what's happening with the game mechanics. I've counted the total number of workstations in my base and it's at least 66 but this is spread out in a multi-layered way but because my base has villagers with beds and jobsites it's probably trying to make a big village with a hard to track boundary. This could possibly explain why my farmers who tend their crops in two 9x9 areas (1 farm above the other) have high outputs on some days and very little on others. They can be looking into space at their jobsite virtually all day, I can harvest a crop and suddenly they go bananas and start harvesting. And I love thunderstorms because it's the only time they fully harvest the full 9x9 area....perhaps it's the linking and non linking that is causing this....(noting your observation that the list is remade every time to the player relogs...) - Many thanks once again!

I hope this gets fixed soon! It's still happening on 1.17.32. I have a big 240 x 240 village with 54 villagers, and with over 100 job site blocks scattered around the village as decoration, it seems that some villagers will never link to any job site, no green particles or anger particles. Even though they already have locked jobs, they behave like unemployed villagers, just wandering around aimlessly.
Restarting the app seems to fix most villagers, after a restart they'll start working again, although some of my farmers will not seek a job site no matter what.

Update: still a big issue on the latest version (1.18.12). The app restarting trick still works, but it might take several tries if you have too many job blocks around. My farmers are finally working again after several app restarts near them, they're finally seeking job sites. After a while they might stop working again (no particles), and I'd have to restart again, which is annoying.
I sure wish there's a tool to point villagers to beds, bells, and job sites in the future!

I've confirmed that it still happens on 1.18.32, 1.19, 1.19.21, and now 1.19.30. I use a lot of job blocks for storage and decoration (barrels, composters, grindstone), and employed villagers will sometimes not work and just wander around without particles. I prefer using barrels as storage because chests seem to cause more lag.

This is still an issue in 1.20.41. It took a ton of testing to find that expanding my lava farm beyond 32 cauldrons was the cause. Once I moved the cauldrons over 32 blocks away, my villagers are taking job sites as they should.

Seeing this after the 1.20.70 update.
Villager trading hall with 10 established librarians that are working and linking as expected. New villager (zillager from a spawner) cured, locked, and brought in from over 100 blocks away. Librarians in a 1x1 cell and standing on lecterns (again other 10 are fine). After trading, 1st 10 reset as expected - new librarian does not reset even after waiting multiple in game days. Villagers are within 20 blocks of 20-30 barrels. There are no fisherman in the trading hall. Breaking barrels closest to bugged librarian causes bugged librarian to reset trades. Confirmed twice by trading and breaking barrels causing bugged librarian to reset. Also noted that breaking the bugged librarian's workstation does not cause normally expected storm clouds. Bugged librarian will also not link to a newly placed lectern when no other lectern is present. All other librarians are trading as expected so no cross linking. No other village within 100 blocks. Bed and lectern used for curing that were located 100 blocks away were also broken and removed as a precaution. No change in bugged librarian after breaking remote bed and lectern.