Basically, when you cause the durability to change on a custom item during the player's current life and the player dies, two of the item drops.
Steps to reproduce:
1. Download https://mcpedl.com/more-tools-addon/
2. apply the addon and enable all experiments.
3. run /give @s sp:emerald_pickaxe
4. run /gamemode s
5. break some blocks or hit a mob or player.
6. run /kill or die somehow
7. Pickup the items
Expected Behavior:
Only one pickaxe drops.
Observed Behavior:
Two Identical pickaxes drop.
The current fix is just removing certain components' children, ie "on_hurt_entity", "on_not_hurt_entity", "on_hit_block", "on_dig", that trigger events that are normally used to create durability since removing the durability event or setting the durability damage to 0 doesn't fix it. fix with notepad++
hover search then click find in files then select the items folder of behavior pack with the three dots button, click regular expression in search and use the following below with replace in files:
find(one line)
"minecraft:weapon": {\n(\s+)("on_hurt_entity": {\n)?(\s+)("event": "\w+"\n)?(\s+)?(},)?\n(\s+)?("on_not_hurt_entity": {\n)?(\s+)?("event": "\w+"\n)?(\s+)?(},\n)?(\s+)?("on_hit_block": {\n)?(\s+)("event": "\w+")?(\s+)?}(\s+)}(,)?
replace(one line)
"minecraft:weapon": {}$19
find(one line)
(,\n)?(\s+)?"on_dig": {\n(\s+)?"event": "\w+"\n(\s+)?}
replace(make sure its leave it blank)
Linked issues
is duplicated by 3
Comments 7
Well, this problem will still happen in 1.17+, especially in some tools addons will have the chance to trigger.
I dunno why.
Is this still an issue in the latest version? If yes, can you please add it to the affected versions (or mention it if you are not the reporter)?
This ticket will automatically reopen when you reply.
Is this still an issue in the latest version (1.17.11)? If so, can you please add it to the affected versions (or mention it if you are not the reporter).
This ticket will automatically reopen when you reply.