Started by
Haxuda_02
on
Topic category: Help with Minecraft modding (Java Edition)
Hello! Help me make an enchantment that can be cast on any item. And then if the player dies in "gamerule keepInventory False", then all items will drop as usual, and the item with this enchantment will not drop and will remain with the player. Please help me do this. Thank you!
If there can only be one item per player: Make an itemstack player persistent variable, on enchantment of the item set the variable to the item being ennchanted. Then on player respawn, check for item with enchantment in the players inventory, if there is none, add one to inventory and add the enchantment if it keeps it.
For more than one item idk. Make more variables, one for each of them.