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

Started by Luky_276 on

Topic category: Help with modding (Java Edition)

Last seen on 12:52, 9. Apr 2023
Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can I make my tool not to break at durability 0 or 1, but it would stop working?

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 05:05, 30. Oct 2022
Joined Mar 2022
Points:

User statistics:

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