When a mob swaps its current equipment for better item, its chance of dropping its old equipment is affected by the drop_chances field. This means zombified piglins, skeletons and wither skeletons (among other mobs) have only a 0.85% chance of dropping their golden sword/stone sword/bow respectively when given a better weapon.
This is a very old bug and MC-77625 clones it.
To reproduce:
/summon minecraft:zombified_piglin ~ ~ ~ {attributes:[{id:"minecraft:movement_speed",base_value:0d}],equipment:{mainhand:{id:"minecraft:golden_sword"}},CanPickUpLoot:1b}
This zombified piglin is similar to one that might spawn naturally in Hard mode, except that it can’t move
/execute at @n[type=minecraft:zombified_piglin] run summon item ~ ~ ~ {Item:{id:"minecraft:iron_sword"}}
The zombified piglin upgrades its sword without dropping its old one (unless you are very lucky and the default 0.85% equipment drop chance succeeds)
/data merge entity @n[type=minecraft:zombified_piglin] {equipment:{mainhand:{id:"minecraft:golden_sword"}},drop_chances:{mainhand:1f}}
This gives the zombified piglin a golden sword again and ensures it always drops its main hand item when killed.
Re-run the command from step 2.
Observe that the zombified piglin dropped its sword this time.
Expected Results:
When a mob swaps its current gear for better gear, it always drops the old gear, regardless of its drop_chances data.
To fix:
When a mob attempts to upgrade its equipment, the corresponding drop_chances entry should be updated before the item is picked up rather than afterwards.
Linked issues
is duplicated by 1
Attachments
Comments 3
Thank you for your report!
After consideration, the issue is being closed as Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – The official Minecraft feedback site
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
I have to disagree with the WAI resolution. drop_chances exists because it is desirable to make it easy (for Mojang and others) to configure under what circumstances a mob should drop its loot on death. This isn’t really the case with gear swapping, it’s sort of expected that if a mob can pick up a better weapon then it should drop its old one, similar to how a player can’t just delete their old sword once they craft a better one, they have to throw it out of their inventory. Even in cases where the player may want to cheese a mob fight by giving the mob better equipment with very low durability, which isn’t really viable anyway, the fight designer would almost certainly opt to disable CanPickUpLoot instead. All in all, the current behavior has no real advantages and just leads to disappointment for players who want to trade a stone sword for a zombified piglin’s enchanted golden one.
We do not have enough information to reproduce this issue.
Please include the following information to help us understand your problem:
Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.
Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki