How can I can save player potion effects after death?

How can I can save player potion effects after death? - Person Holding Pizza on Yellow Table

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?



Best Answer

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:

enter image description here

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.




Pictures about "How can I can save player potion effects after death?"

How can I can save player potion effects after death? - Free stock photo of art, artistic, business
How can I can save player potion effects after death? - Man in Black Jacket Leaning on Gray Metal Fence
How can I can save player potion effects after death? - Man in Black Jacket and Blue Denim Jeans Sitting Beside Gray Metal Fence



How do you give a player a permanent potion effect in Minecraft?

Just as it says on the tin. If keep inventory is on, players with potion effects on them should keep the potion effect when they die, with the timer paused until they respawn.

Does keep inventory keep potion effects?

If the player dies while under the effects of a God Potion without having a Booster Cookie active, they will lose all their God Potion effects.



Keeping Potion effects after death




More answers regarding how can I can save player potion effects after death?

Answer 2

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.

Answer 3

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.

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Ardalan Hamedani, Felicity Tai, Nicola Barts, Nicola Barts