At times, villagers become preoccupied with trading carrots (or, presumably, other crops). They form clusters and repeatedly throw them at each other, only to throw them back again. The attached video shows this happening in a particular desert village that has 13 villagers, 12 of them farmers. On several occasions I have seen 12 of the 13 engaged in this pointless activity.
Thinking that their inventories were full, I checked with an NBT editor. The 4 villagers in this video each had from 3 to 6 carrots in its inventory, two of them had 3 and 5 carrots in their main hands, and all had 3 or 4 empty slots, so that wasn't why they were swapping. Note that I have also seen these villagers walking around with carrots in their main hands when they weren't engaged in swapping. It makes me wonder whether their AI doesn't allow them to have more than a small number of carrots in their inventories. Each swap might then exceed the recipient's limit, causing the behavior to repeat without limit.
Attachments
Comments


Yes, this is very annoying but not limited to carrots. Mine do it with any trade. There was a much older bug that had villagers throwing veg indiscriminately and perhaps linked with that as a complete solution might not have been found. Mind you, it is great to stand in amongst the group and pick up some free veg as I think the fault lies with the veg somehow being created during this process and nothing to do with how much they actually had to share in the first place.

This is happening in my desert village as well, with beets. The farmers(all types) won't pick up carrots for farm any other crops. Librarians and other villagers are running around with beetroot seeds.

Also affects Xbox One 1.4.2. I had a pod of 4 farmers today all throwing potatoes at each other. They do have access to potato crops nearby (and only potato crops) so in my case anyway they wouldn't necessarily need to create tubers out of thin air. It sure looks like a glitch in the villager inventory trigger mechanism, where villager A will toss food to "hungry" villager B, causing villager A now to become "hungry" and B tosses some back. In my case it was a 4-way infinite-hunger loop. š

An update to my previous: yesterday I went into the village to find every single villager holding potatoes in their hands, and bunches of potatoes lying all around. Far more potatoes than I think could be farmed on the 10 or so tilled spots they have in their enclosed village. So perhaps they are spawning potatoes out of thin air...
I have removed all of the tilled land to see if they continue with the tater fest they seem to be having.

I have the same bug as well,Iām on iOS on a iPad mini 3. Villagers in my village keep throwing carrots at each other,and some keep holding a carrot.

I have found the cause of this problem. In the vanilla behavior pack, file villager_v2.json, the shareables
component for peasants has an entry for carrots with the parameters "want_amount": 60; "surplus_amount": 4
. These parameters are also duplicated in the farmer's work schedule. The corresponding carrots entry for non-peasants has "want_amount": 60; "surplus_amount": 24
(24 instead of 4), and so do the entries for potatoes in all three components. I'm convinced the "4" amount is a typo and should be 24.
The way sharing works is that the giver looks at its inventory for carrots to see if it has more than surplus_amount. If so, it drops as many as it has up to the other villager's want_amount. So if one villager has a full stack of carrots, it will drop 60. The other will then pick those up, but since it now has a surplus and the first villager no longer does, it gives them back.
I'm not certain the problem wouldn't occur at all if the surplus_amount were 24, or that it can't occur for potatoes. In fact, I think it will occur for any food if there's a glut of that food type is given to villagers. But with a higher surplus_amount, villagers will retain more carrots and the capacity of the combined villagers will be greater, so there's less likelihood of this occurring.
Is this still an issue in the latest version?

Mega_Spud, yes, this is still an issue in the latest version. This bug has the capability to crash a Realm, and should be fixed before the next major release. REALMS-3089

Thank you for taking the time to respond, however the question asked in January by Mega_Spud was rendered moot by the developers fixing the problem in the 1.15.0.55 Beta release in early March. Since we're skipping a 1.15 official release, it should reach official releases with the 1.16 version, for which no date has yet been announced.

Yes I see the same issue glad this is being fixed it's getting annoying now
thanks for fixing
Resolving issues that were marked as fixed in the 1.15 and 1.16 Betas, now that 1.16.0 is being released.