mojira.dev
MC-48735

Villager and farmer inventory gets corrupted causing farmers to no longer plant crops

As a village progresses and grows it seems to reach a point where suddenly the ability of the farmers to harvest and plant crops collapses on itself.

The problem starts off by seeing food on the ground everywhere and eventually farmers will harvest crops but not pick them up. Over time the farms get picked clean until there is nothing left. A check on the villager inventory in NBT Explorer shows that the villagers and farmers are winding up with full inventory slots despite those slots containing 0 items. It seems that once an inventory item is depleted the slot should be opened up again so the villager can once again gather new items. In fact I believe that the AI thinks the slots contain 64 items and this is why the villagers cannot pick anything up - it seems to be a dual problem: the villagers think they have full inventory so they pick nothing up, but, in reality the slots contain nothing so when a farmer gets hit with this bug he cannot plant anything.

This is especially bad for farmers because if their slots become corrupted they can no longer pick up the items needed to replant the farms (it seems to be mostly related to bread - once the bread is depleted the inventory slot stays occupied and if all 8 slots become like this the farmer can no longer plant crops).

I have made some screenshots to show the progression of the problem along with an image highlighting the issue as I found it in NBT Explorer - when I spawned a new farmer and gave him 128 seeds he was able to plant them without problem and once the seeds were planted the slots opened up as they should.

This does not happen when farmers are limited to crops such as carrots and/or potatoes - it happens when they get access to wheat. The assumption is that because harvesting of wheat results in drops of both wheat and seeds and because wheat is crafted into bread somehow this causes the inventory slots to get corrupted.

This was a fully functional and viable village and now it has collapsed on itself - the only apparent solution to this right now is to kill of all the villagers and start with new ones.

Linked issues

Attachments

Comments 33

thank you for that in depth report!

the graphic says 7 of 8 slots are occupied by bread. I assumed, if the farmers get bread of certain amount, they will share it. I tested throwing stacks of bread into the farmer, but he refuses to share it.

seems like the values of bread freeze after a while. maybe because of that, new slots are occupied by bread and get stuck later too.

The main issue is: when it comes to the point that the villager is "saturated" (has enough bread) he stops his work (as he should do).
if the numbers freeze at this time, he will not gather new food.

unlike in the title, in my tests the villagers replant the crops if you clear the farmland. if the farmer runs out of seeds and you give him seeds back, he will continue planting, but doesn't care about the full grown wheat to be harvested.

this in addition,
greetings
Musel

TO MUSEL: I raided the fields a few times in the new snapshots and from what I can see anything you plant won't get harvested by them. They leave YOUR crops alone. I had to train myself to be an inconsiderate lout and not replant after I stole wheat. It had become instinct to replant, like closing a door behind me.

I've done some test in the Snapshot 14w11b and using NBT Explorer to check the results :

  • Farmer stop harvesting as soon they hit 60 items in their inventory, it does not matter if the items are split into multiple slots.

  • If by any means (toss at another villager, plant on new crop, etc.) the items count in their inventory drop below 60 they start harvesting again.

  • It affect carrots, potatoes, wheat, seeds, bread.

With 21b I created a brand new map and I created three farms to see which village would grow faster based on the crops they planted and consumed. All three started off with the same conditions except one village got 128 carrots, one got 128 potatoes, one got 128 seeds. Each village started with 3 villagers: 2 farmers and one random one.

After the end of 36 Minecraft days we have a problem: the wheat farmers are jammed up again - when they harvest wheat they can't pick up seeds again.

I'm sorry to say but the bug has not been fixed. It exists in 21b as well.

23 more comments

Appears to be fixed in 1.12.2 (maybe earlier); using NBTExplorer no longer shows inventory slots with count zero when villagers share bread or use up all of their seeds. The world and villagers were both created in 1.12.2 so I'm not sure if this would still affect older villagers.

This issue is NOT "resolved" and never has been!

This is still an issue in the 20w22a snapshot. The same applies to beetroot.

If this is still occurring, please create a new report with exact reproduction steps.

Patrick Callahan

Jens Bergensten

Community Consensus

villager

Minecraft 14w06b, Minecraft 14w21b, Minecraft 14w25b, Minecraft 14w30c, Minecraft 14w34b, ..., Minecraft 1.9.2, Minecraft 1.11, Minecraft 16w50a, Minecraft 1.11.1, Minecraft 1.11.2

Minecraft 14w21a, Minecraft 1.8, Minecraft 1.12.2

Retrieved