Hey guys, I have a redstone related question here because I am having trouble with getting a certain command right and was wondering if anybody knows what I could do. I want to test for a player with 19 health (9 and a half hearts) and kill them specifically if they do (That means they originally had 10 hearts bu lost half a heart.) Anyone have any ideas on the command? [I have a fast redstone clock set up] Thank you a lot if you can find out!
You have to be on 1.9 to use the tag function. It's also possible to do under 1.9 with objectives but tags save a command and some unneeded space.
Ok so this command fully works except for one thing. My friend lost health and nothing happened. Then I lost health and I got killed. Then my friend got hit again and we both died (I was spectating in creative mode at that point). Any idea on the problem?
Oh yes, I forgot for some reason. The first command should be /scoreboard players tag @a[tag=hit] remove hit then the second is /scoreboard players tag @a add lostHalf {Health:19f} and the third is /kill @a[tag=lostHalf] As for your friend not dying when they lost health, no idea, but this solution might fix it.