Based on 1.11.2 decompiled using MCP 9.35 rc1
The rules for when a mob which can pick up items should pick up items are currently (method net.minecraft.entity.EntityLiving.updateEquipmentIfNeeded(EntityItem)):
Note: This shows the pseudo code with the fix for
The problem here is that if the mob has a less damaged item equipped but the item to pick up has NBT data it will swap the equipped item. However, after that the item to pick up is less damaged and therefor the mob swaps them items again and so on.
- Summon a mob which can pick up items
- Set the mobGriefing gamerule to true if it is not already
- Throw a undamaged chestplate at the mob
- Throw a damaged chestplate (with NBT) at the mob
Note: Because of
MC-44283 the item in step 3 has to be nearly broken while the item in step 4 has to be slightly damaged.