mojira.dev
MCPE-128897

Durability causes custom item duplication on death

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

Comments 7

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.

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.

This is still an issue in both release 1.18.10 and preview 1.18.20.26

I encounter the same problem. Oops

Still an issue in 1.19.10

Still an issue in 1.19.20

mrpatches123

(Unassigned)

748933

Confirmed

Multiple

All

1.16.221 Hotfix, 1.17.41 Hotfix, 1.18.12 Hotfix, 1.19.11 Hotfix

1.19.30.22 Preview, 1.19.30

Retrieved