How can I make my tool not to break at durability 0 or 1, but it would stop working?

Started by Luky_276 on Sun, 05/29/2022 - 07:11

Topic category: Help with modding (Java Edition)

Last seen on 18:42, 29. Jun 2022
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How can I make my tool not to break at durability 0 or 1, but it would stop working?
Sun, 05/29/2022 - 07:11

The title pretty much explains it. I want to make a tool that doesn't break at durability 1 or 0, but I want it to stop working. Thanks in advance.

Last seen on 22:10, 29. Jun 2022
Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Make a new item for the …
Sun, 05/29/2022 - 15:10

Make a new item for the "broken" state then do something like:

 

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]