So, here's what I wanna do: I have an item that's supposed to be used with another block that would damage it (if you want specifics, it's supposed to be for Pyrotech's chopping block). I want it so that once the item runs out of durability, it'd transform into another item rather than breaking outright. I can't seem to figure out how I'd do this, though. Here are the things I've tried:
Edit the setDamage function. Problem is, there's no method to change the stack's item or get the holder of the itemstack that I've seen, so it wouldn't work.
Use onItemUseFinish. It...doesn't seem to fire at all with this.
Subscribe to PlayerDestroyItemEvent. This feels too unspecific, and the event might fire when I don't want it to.
Is there some way of doing this properly?