The bug
When a mob wearing randomly-generated armor is killed and the armor drops, it is given a random damage value. However, when a mob chooses to swap its spawn armor for a better piece of dropped armor, the original piece is dropped fully repaired instead of getting randomly damaged.
How to reproduce
Simply drop a piece of better (e.g. diamond) equipment next to a mob that is both wearing natural equipment and can pick up loot. It will replace its item and drop it fully repaired. If the mob were to be killed instead, the damage value would be randomized.
Example command (turn mobGriefing
on and drop a diamond chestplate at this zombie's feet):
/summon zombie ~ ~ ~ {ArmorItems:[{},{},{id:leather_chestplate,Count:1b},{}],ArmorDropChances:[0f,0f,0.99f,0f],CanPickUpLoot:1b}
Note that the damage is not caused by damaging the mob. The random damage is applied on death and is not changed over the lifetime of the mob.
Random Armchair
To fix, maybe random mob equipment can just be pre-damaged from the beginning? That way, you won't have to update the item every possible way it can drop, and also won't need a special case anymore for 2.0
drop chance to leave damage untouched.
Attachments
Comments 13

Ah, that makes sense. For a while I've thought that wasn't the case, and was confused at the seeming "exploit" of throwing a mob a better item just so you can kill it and get both 100%.
Glad to see my anxious suspicion that I never tested was false, hahaha.
Can confirm that this is still an issue in 20w49a.
Can confirm in 21w03a.
Can confirm in 21w05a.
Video attached.
Affects 1.17
Can confirm in 1.17.1.
Affects 22w13a
Can confirm in 1.19.2.
That happens because the armor / hand drop chances are used in this case as well, which is very likely intended.