3

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?

pppery
  • 3,876
  • 8
  • 27
  • 47
Andrew
  • 501
  • 1
  • 4
  • 15

1 Answers1

5

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.

Aaron128l
  • 1,197
  • 1
  • 6
  • 22