Topic category: Help with Minecraft modding (Java Edition)
I am trying to accomplish when a player dies and has another item on it that the certain item is added back to the player's inventory. Such as if keep inventory was on a selected item. But I struggle with the item adding back into the player's inventory as soon as they die, before the player dies the game notices and adds the item into the inventory. I need it to wait until the player respawns for that item to be added back but I am unsure of the command to do so. I apologize if this is confusing. So background knowledge is that Netherite doesn't burn in lava because it is made for the nether, I was wanting to make an Ender type of this armor. Where most of the end is the void, so the Ender infused items would stay as keep inventory would, but on those select items only. If you could help me through it, I would appreciate it a ton.
on top of a procedure one of the trigger are player respawns, but I think you will need 2 procedure on to check if the player has those items when he dies and the other to give him those items, although I think you will also need to use variables, lets say you have a ender chestplate, that chestplate will have a variable called... End_CP and its a numbered variable and should be a lifetime variable resetting after death so it can loop again, you would need to check if the player has that chestplate when he dies and it gets added to that variable and make the second one for when the player respawns check if any of the variables are 1's if they are give the player this item, then it will be set to 0 automatically, but I can't help you with carrying over the enchantments/names or any other altercations you've done, I hope I was able to explain well enough.