How to detect when an item breaks?

Started by swelkinn_n on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to detect when an item breaks?

literally none of the other posts on this forum explain this (let alone working methods),

i just want to make my tool give the player a broken version of itself when it breaks

help,???

 

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create a new procedure : …
Sat, 04/30/2022 - 05:10

Create a new procedure :

(trigger) when a item is destroy

If item in the player hand is an [your item]

Set [your item broken] in the player hand

 

tell me if it doesn't work

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Global trigger : "Item is…
Sat, 04/30/2022 - 05:37

Global trigger : "Item is destroyed".

If [provided itemstack] = "your tool"

     If [item in main-hand] = [empty itemstack]  (hand should be empty, but verify just in case)

          Set item in main-hand of [event/target entity] to "broken item"

          Copy NBT tags of [provided itemstack] onto [item in main-hand]

Joined Sep 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
i want to make something…
Wed, 11/15/2023 - 14:21

i want to make something similar to this, so could you show an image of the procedure?

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hum that thing wont work…
Fri, 12/08/2023 - 10:56

hum that thing wont work valirane, (2023.3) what you mean by NBTs there? is that part really necessary just for replace the item? i use my item, damage it until it destroy, but the second item (empty item) wont spawn on player main-hand

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(trigger) when a item is…
Fri, 12/08/2023 - 10:59

(trigger) when a item is destroy

If item in the player hand is an [your item] <-- this prb wont work because the item will be already gone when you fire that condition