mojira.dev
MC-112198

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

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

marcono1234

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.

tryashtar

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.

Avoma

Can confirm that this is still an issue in 20w49a.

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05a.

3 more comments
Avoma

Video attached.

Marty McFly

Affects 1.17

Avoma

Can confirm in 1.17.1.

Marty McFly

Affects 22w13a

Avoma

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.17.1, 22w13a, 1.19.2, 24w45a, 25w09b

Retrieved