So lets say you have an entity which happens to be of type=Player
.
Such that a command block, when powered
testfor @e[r=15,type=Player] {}
will output true.
Now, lets teleport this player
tp @e[r=15,type=Player] ~ ~ ~ -90 45
They should now be facing due east and at the ground.
Now if I test for this:
testfor @e[r=15,type=Player] {Rotation:[0:-90f,1:45f]}
I'll output true as well.
Now the player turns around. the same command block will now output false (Proving that the command block has successfully tested for a players rotation)
but the rotation is a floating point number, having many decimals of accuracy, and the only way to have it tested and it be true (unless you get realllllly lucky and land on exactly -90.000000000) is to tp the player to have that rotation.
I'd like to be able to test for a player's rotation, but in a natural state.
So the fundamental question is... Can i test for a data tag which is Close to a given value?
Ideally it would look like this:
testfor @e[type=Player,r=15] {Rotation:[0:{min:-45,max:-125}]}
but I know this is wrong. So anyone, has anyone found a solution to testing for approximate data tags?
@e[type=Player]
should be equal to@a
, so there's no reason to use the former. – MrLemon Oct 24 '14 at 8:43