-
Bug
-
Resolution: Cannot Reproduce
-
None
-
Minecraft 1.11.2, Minecraft 1.13, Minecraft 1.13.1
-
Confirmed
-
(Unassigned)
The bug
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)):
(itemToCheck.getDamage() < itemEquipped.getDamage()) OR (itemToCheck.hasTagCompound() AND NOT(itemEquipped.hasTagCompound()))
Note: This shows the pseudo code with the fix for MC-44283.
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.
How to reproduce
- Summon a mob which can pick up items
/summon husk ~ ~ ~ {CanPickUpLoot:1b}
- Set the mobGriefing gamerule to true if it is not already
/gamerule mobGriefing true
- Throw an undamaged chestplate at the mob
/give @p diamond_chestplate
- Throw a damaged chestplate (with NBT) at the mob
/give @p diamond_chestplate{Enchantments:[{id:unbreaking,lvl:1s}],Damage:1}
The mob constantly swaps the items
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.