Started by
Guacaroni
on
Topic category: Help with Minecraft modding (Java Edition)
It seems fairly easy. Just put the item in an anvil and set the repair item, but I want to set up a different system. In said system, items will slowly repair, but for free. The problem is, I don't know how to restore durability. Just sacrificing an item and giving a completely new one is the easy way, but that's not what I'm interested in. For example, after a trigger happens, like right-clicking or something, 1 use will be restored to the item in hand.
It can be done with procedures:
Set durability of itemstack to: get durability of itemstack + 1
I'm not sure why, but it didn't work. I tried it with a wooden shovel initially, but it didn't work. On the off chance it doesn't affect vanilla items, I made an item called test shovel. I destroyed a block with it, making its durability 49 out of 50. I right-clicked blocks, and nothing happened. I am new to this, so I might be missing something obvious.
Okay, I found my mistake. Thank you for your help; it works.
No prob :)
It doesn't seem to be possible with vanilla items, unless I'm missing something. Test shovel works great, but when I change itemstack to a specific item, like the vanilla shovel, there's no effect whatsoever. If it's possible to edit a vanilla item, other than what they drop, I don't know how.
Nevermind; I figured it out, to a certain extent.