Started by
Vladius120
on
Topic category: Help with Minecraft modding (Java Edition)
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?
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
thank you