I have an /execute
command in a repeating command block, such as:
execute @a ~ ~ ~ say hi
This makes every player say hi every tick, even if they are dead and at the 'Respawn?' screen.
How would I make the /execute
only happen if the player is alive?
Best Answer
This can be done with the
health
scoreboard. Create an objective with:This creates an objective
h
, which tracks player's health (by number of half-hearts).Change your command to:
This only triggers if the player has at least a half-heart (they're alive).