Why does testfor sometimes output an error?
This happens when the command finds no entities that fit into all the parameters and conditions you entered - it's just a false output. For example, if you enter
/testfor @e[type=ThisIsNotAValidEntityType]
it will always output an error (case 1 above). If you want to stop this showing, edit the command so that it "fits" at at least one entity or place an entity so that it fits the commands.
This command will aslo always output an error, but this time the error will always be the entity UUID is an invalid format
(case 2 above):
/testfor @p[score_x_min=3,score_x=2]
On the other hand, if you type a command like so:
/testfor @e[type=Creeper,c=-1]
you will get a false output (the entity UUID us an invalid format
) only if the farthest entity from you isn't a Creeper (case 3 above).
But, if your testfor command may theoretically target more entities, and doesn't, eg.
/testfor @e[type=Creeper]
/testfor @e[score_x_min=3,score_x=2]
then you will not get any output at all (case 4 above).