mojira.dev
MC-112198

Natural mob equipment is not randomly damaged when swapped with another item

The bug

When a mob equipped with randomly-generated armor or a weapon is killed and the item drops, it is given a random damage value. However, when a mob chooses to swap its spawn equipment for a better item on the ground, the original item is dropped fully repaired instead of getting randomly damaged.

How to reproduce

  1. /gamerule mob_griefing true

  2. /summon husk ~ ~ ~ {equipment:{chest:{id:"leather_chestplate",count:1}},drop_chances:{chest:0.99f},CanPickUpLoot:1b,Health:0.1f}

  3. Kill the husk
    -> ✔ It drops a damaged leather chestplate

  4. Run the command again

  5. Drop a diamond chestplate at the husk
    -> ❌ It drops an undamaged leather chestplate

Note that the damage to the item is not caused by damaging the mob. The random damage is applied on death and is not changed over the lifetime of the mob.

Suggestion

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

I've also noticed that sometimes the original loot isn't dropped at all, but I can't find a way to reproduce that specifically.

That happens because the armor / hand drop chances are used in this case as well, which is very likely intended.

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.

3 more comments

Can confirm in 1.17.1.

Can confirm in 1.19.2.

tryashtar

(Unassigned)

Confirmed

Items, Mob behaviour

armor, doMobLoot, equipment, mob

Minecraft 1.11.2, Minecraft 17w06a, Minecraft 17w13a, Minecraft 17w14a, Minecraft 17w15a, , 1.19.2, 24w45a, 25w09b, 26.1.2, 26.2 Snapshot 3

Retrieved