Is it possible to check for an injured player in Minecraft?

I am creating a mini-game in Minecraft, where I must check to see if the player is injured. The injured player will then be given an item. My guess is that the command would look something like /testfor @p[injured=true], but this command doesn't work. Is there a command for this?


Solution 1:

No there is no direct command in Minecraft for injured. However you can use a scoreboard to track if the player has taken damage. You can start by adding a scoreboard objective with the following command:

/scoreboard objectives add Health health

You are then able to detect (/testfor) if someone is not at 20 health using a command block or though the scoreboard.

Learn more on the Minecraft Wiki.