Is there some way that I can save player potion effects after death? I have already tried this command: /gamerule keepInventory True but it doesn't work. Is there any way to save player potion effects after death?
This problem can be solved like this:
If they obtain the potion effect via redstone switch or button, then have that switch or button set off a redstone signal leading to command block, as shown in this picture:
The Command block branching off to the right of the button will give the player the effect, and the one branching off to the left will place the block of redstone shown above it. This will cause an extremely rapid redstone clock updating the command block thats connected to the clock. This will check for player death. If a player death is detected, it will cause the comparator to send a signal to the connected command block and will give the player their effect back. This method works as of minecraft 1.7.10.
Well, for my 1.12.2 map, I just made a redstone clock out of observer blocks (new 1.12.2 redstone things) and I wired it to a command block constantly giving saturation to @a (all players). In the rules section of the map I just told the players to disable the chat so they wouldn't see the constant spam, but I'm still looking for a better way.
I'm not very good when it comes to redstone but I have a map I'm making with a character select and each character has their own effect that last's forever I've done this by making the button lead to a structure block that spawns a command block with the effect already typed into it connected to this command block is a daylight sensor this way the effect is restored daily if you change characters the command block is replaced with the character's effect. I know this isn't exactly what you might be looking for but it works and I've used it in my map.