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 Minecraft modding (Java Edition)

Active 1 year ago
Joined Dec 2021
Points:
400

User statistics:

  • Modifications: 0
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 2
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.

Active 2 years ago
Joined Mar 2022
Points:
370

User statistics:

  • Modifications: 0
  • Forum topics: 4
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 65
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]