Started by
mobjack878
on
Topic category: Help with Minecraft modding (Java Edition)
I'm trying to make a treasure enchantment you can apply to any item with durability that makes it Unbreakable. I don't really know what I'm doing. I got the enchantment book to appear in the creative inventory and it can be applied to items. What event trigger should I use? I didn't see a trigger related to using an anvil. Also, how do I refer to the player? It gets mad at me for trying to refer to the item in the main hand of an entity that doesnt exist.
Try "on player tick update" and for all slots in the player's inventory, if it has the enchantment, reset durability.
i tried it with the "for each slot of inventory of entity get contents copy as itemstack iterator", but i dont know how to change that item in the inventory because im only getting a copy of the slot.