This would be a new feature that can work on both Spigot and PaperMC
Original considerations from #3:
@percyqaz:
Anvils could receive random damage as you've pointed out. Adding damage to the anvil while it's in the inventory sounds simple but is actually about the same difficulty as the main feature of opening and editing shulker boxes (I have to think about what happens when it's a stack of anvils, or if you move the slot the anvil is in while using it, for example)
Things required to add this feature as originally described, where the anvil can take damage:
Only allow opening 1 anvil and not a stack of anvils in your hand
Lock anvils in place once open the same way shulker boxes are locked
Add code to prevent moving locked anvil by any inventory interaction
Simulate vanilla probability (12%) of taking damage, and apply to the stack whenever the user crafts something*
Close the anvil if the item breaks completely
*this is the part I'm particularly not sure about, because it means I have to detect an anvil craft event specifcally when the player is using a "virtual" anvil and not one in the world
Basically the code for this could be a bit of a mess, but I will sleep on it and maybe if it gets requested by more people I can add it
If I'm doing this I'm doing it ignoring anvil durability
This would be a new feature that can work on both Spigot and PaperMC
Original considerations from #3:
@percyqaz:
Things required to add this feature as originally described, where the anvil can take damage:
*this is the part I'm particularly not sure about, because it means I have to detect an anvil craft event specifcally when the player is using a "virtual" anvil and not one in the world
Basically the code for this could be a bit of a mess, but I will sleep on it and maybe if it gets requested by more people I can add it
If I'm doing this I'm doing it ignoring anvil durability