Making Command blocks send redstone currents upon player death
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!
Pictures about "Making Command blocks send redstone currents upon player death"



Can a command block activate Redstone?
A command block can execute commands when activated by redstone power.How do you activate a Redstone command?
You can also set your Command Block up to be powered by Redstone. Selecting \u201cNeeds Redstone\u201d will make it only activate if the block has Redstone. Selecting \u201cAlways Active\u201d makes the command run regardless. Whatever command you want set up goes into the \u201cCommand Input\u201d section.Are command blocks in survival?
Activate the Command Block So you would activate the command block by toggling the lever. To activate the command block: If the redstone device is a lever, you need to toggle the lever. If the redstone device is a button, you need to push the button.how to activate Redstone with a command block
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: RODNAE Productions, Alfo Medeiros, Yan Krukov, Yan Krukov
