How to detect when an item breaks?

Started by swelkinn_n on Sat, 04/30/2022 - 02:16

Topic category: Help with modding (Java Edition)

Last seen on 19:31, 4. Aug 2022
Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to detect when an item breaks?
Sat, 04/30/2022 - 02:16

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,???

 

Last seen on 15:54, 5. Jun 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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

Last seen on 01:49, 8. Aug 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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]