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?

1

1 Answer 1

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.

2
  • Thank you! This is exactly what I needed. Thanks for the help!
    – Andrew
    Dec 7, 2013 at 1:59
  • 1
    @Tech No problem if you need any help with the command you know where to find me.
    – Aaron128l
    Dec 7, 2013 at 2:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .