Minecraft – Making Command blocks send redstone currents upon player death

minecraft-commandsminecraft-java-editionminecraft-redstone

I am making a huge map (Not giving any spoilers!) it's taken me 13.4 days to make this, yet I ran into one problem. When a player dies the redstone still flows.

I was wondering if there is a way for a command block to detect whenever a player dies and be able to make it able to restart?

Best Answer

I believe you are asking for a way to send a redstone current whenever a player is "dead" (died and didn't hit respawn).

In Minecraft, being "dead" means you have 0 health, right? So all we need is a command to check their health. Luckily, that's pretty easy! All entities (or maybe just mobs, not 100% sure) have a "Health" tag. All we need is a testfor checking if you have 0 health, using this command:
/testfor @a {Health:0.0f}

What does the 's' mean?
Health is what is known as a short, a type of intsger value used in programming. You may have seen values such as "1b". 'B' stands for byte, a similar value, but with a smaller possible value. Bytes can store a number from -256 to 255, and shorts can store a number from -32,768 to 32,767.

One more thing! To receive the current, you must have a redstone comparator hooked up to the /testfor command block.
I hope this is what you are looking for! Just leave a comment or edit your question if this isn't!