I have a problem with my redstone/command blocks circuit. My redstone circuit:
In command block 1, the command in that block is:
/testfor @a [score_health=19,score_health_min=1]
(this sends a redstone signal when their is a player with less than 10 hearts).
In command block 2 the command is:
/replaceitem entity @p slot.armor.head diamond_helmet 1 0
(when activated it places a diamond helmet on your head)
The rest of the commands are for other armor pieces.
When someone has less than 10 hearts, it activates the other commands but gives the nearest player the armor. How do I make it so that the "armor wear" commands only effect the player who has less than 10 hearts?