Started by
MrWinston27
on
Topic category: Help with Minecraft modding (Java Edition)
I am trying to create an item that while in your inventory, allows you to keep your items/exp upon death. This is the first time I have ever used MCreator and I don't want to let my friends down since I told them I could get this done.
Actully think it is not possible without coding, you can change gamerule when item is in inventory but that would change it for everyone.
I’m not sure about keeping your items, but keeping XP is simple!
When a player dies with the totem in a hand, set a global variable to the amount of xp they have before they died.
Then, set another global variable that confirms they used a totem.
On tick, see if the second global variable (if they used a totem) is true. If it is, set the players xp bar to that first global vwriable(xp before death)
what you could try doing is setting the gamerule to keep inventory before death the right immediately after death change it back that way the only people effected are you and any one else that manages to die on the same tick as you witch can only be accomplished with the kill command altho i dont know how to do it