How do you make a item consistently lose durability in your inventory

Started by levanderstonegaming on

Topic category: Help with MCreator software

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do you make a item consistently lose durability in your inventory

I'm trying to make a item that will lose one durability point a second. However, when I use the "deal 1 damage to item" block, it does one damage. I have it to run on a effect to do the damage consistently, but it does one damage and then stops. Also, if you can, could you tell me how to make a GUI fot that item to repair it on spot. Thanks

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
What trigger is your…
Fri, 10/04/2024 - 00:40

What trigger is your procedure on, use either in inventory tick or in hand tick trigger event. For a gui, make a gui and make a on right clicked procedure: open custom gui. In gui make a button or whatever/however you want to repair it and either replace the item with a new one or set its damage to 0.

Also because you want it to do one damage per second you have 2 options. Either make the durability 20x its current to make it seem as if it goes down by 1 per second. Or make a local variable cooldown in your on tick procedure; the cooldown being 20 ticks so the item gets damaged on tick every 20 ticks.

Joined Jul 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks. I have another…
Wed, 10/09/2024 - 17:48

Thanks. I have another question though

I have it so the item loses durability if you have a potion effect. If you don't have the item, you're supposed to take damage. However, when I hold the item I still take damage. Do you know how to fix this glitch?

Thanks in advance