mojira.dev
MC-9097

/testfor producing true comparator signal with invalid parameters

I place a command block and give it this command:

/testfor @p[x=180,y=56,z=22=,r=10]

I connect a comparator to the command block(comparing mode) it remains "false" until power is connected. Once a redstone clock is connected the comparator outputs a "true" signal even when a player is not anywhere near the coordinates and the signal is constantly being refreshed by the clock. When the clock is deactivated the comparator still remains powered unless the command block is removed. It also becomes powered even if the previous result was false.

However when the command is changed to:

/testfor @a[r=10]

the command block is connected to the clock the comparator issues true/false commands when the player is within that radius as normal. I feel like other players have mentioned this a lot but been ignored because their complaints were rather vaguely worded. Any help would be wonderful, thank you.

Linked issues

Comments 11

Confirmed. Reformatted and renamed the issue.

I don't know if this is the right place to say this, but isn't it better the command block only gives a pulse when the command works correct? If you use testfor playername and the commandblock is activated once, he gives constantly a true signal, also if you logout and login, until you break the block.

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

I am unable to reproduce this in 13w19a singleplayer. [MC-12693] describes a similar bug which is supposedly multiplayer-exclusive; I have not tested it however.

1 more comments

Reopened. Confirmed issue still exists in 1.6.2, and also happens on all commands that have invalid parameters.

Able to reproduce now that I noticed there's an extra = sign after the z=22. Thanks for updating the description to make it clear that this only happens when selector arguments* are considered invalid.

*I'm not sure how many people are aware, but the official name for @p, @a, and @r are apparently "selectors", and the contents of the brackets are "selector arguments".

Is this still a concern in the current Minecraft version 1.7.4 / Launcher version 1.3.8 or later? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Is this still a concern in the latest Minecraft version 14w30c? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

Works in 14w30c. I think this can be closed.

Pvt_Meatshield

(Unassigned)

Confirmed

Snapshot 13w05b, Minecraft 1.5.2, Minecraft 1.6.1, Minecraft 1.6.2

Minecraft 14w30c

Retrieved