Can I use inequality in command-block testfor arguments?
I know there is the basic /testfor @a[score_HEALTH=1,team=red] but I need the "less than" argument.
How can I denote inequality, as in @a[score_health<20] instead of =20?
when I do score_health<10 it just gives me an error.
Best Answer
As of Minecraft 1.13, score arguments are specified using ranges
selector[scores={OBJECTIVE=min..max}]
Therefore, to select all players with "health" scores less than 10, do @a[scores={health=..9}]
Pictures about "Can I use inequality in command-block testfor arguments?"



How do you Testfor with command blocks?
How to Enter the CommandWhat replaced the Testfor command in Minecraft?
The /testfor command became obsolete in Minecraft 1.13, and has been replaced by the /execute command*. It will do the same as typing /testfor @e {SelectedItem:{id:"<item>"}} and then putting a comparator to the command block with the command, and then running the command which you wanna run.How do you use command blocks with conditional?
"Conditional": A command block in conditional mode will only execute its command after the command block behind it has executed successfully. ("behind it" in the sense of opposite to the direction the command block is facing, regardless of chain direction or even if chaining is occurring).What does @R mean in Minecraft?
The other target selectors are \u201c@a\u201d for all players, \u201c@r\u201d for a random player, and \u201c@e\u201d will target all entities. Entities include everything that isn't a block, like monsters, snowballs, animals, and arrows.What do all these arguments do and mean?? | Minecraft PE commands
More answers regarding can I use inequality in command-block testfor arguments?
Answer 2
OK I'm so happy but thanks to AoElite i found the answer. here it is. /testfor @a[score_health_min=3,score_health=9] modify that and you have the ultimate minecraft team respawn/death command for command blocks.
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Anete Lusina, Brett Sayles, Plato Terentev, Anh Tuan
