Please help with the procedure

Started by Vladius120 on

Topic category: Help with modding (Java Edition)

Last seen on 16:22, 17. Jun 2024
Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Please help with the procedure

How can I prevent an item from wasting its durability (when killing mobs, breaking blocks, etc.)? But how can we make sure that this item spends 1 durability every 60 seconds and that instead of breaking the item, another item appears in its place?

Last seen on 16:03, 25. Jun 2024
Joined May 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Do a procedure on global…
Mon, 06/17/2024 - 19:14

Do a procedure on global update tick that if the item is in main hand of entity remove one durability every 1200 ticks (1 minute) until the item only has 1 durability left. After that do a delay 1200 ticks the replace item with other item.

The preventing damage is harder, but I think you can find out how much durability is taken when the item is used and make a procedure with the global when item is used and see if its then item then add the durability back to it. Only problem is when the item gets used at 1 durability. So this probably won't be able to get used.

-PixelKid