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?
Asked
Active
Viewed 4,196 times
3
-
Somewhat related: http://gaming.stackexchange.com/a/138526/1351 – MBraedley Dec 07 '13 at 01:54
1 Answers
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.
-
-
1@Tech No problem if you need any help with the command you know where to find me. – Aaron128l Dec 07 '13 at 02:01