mojira.dev
MC-90089

Rotation arguments in selector and debug screen rotation differ

The rotation arguments ry, rym, rx and rxm do not test for the value displayed in the debug screen (F3).

The selector arguments use a scale from 0 to 360 whereas the debug screen shows the rotation from -180 to 180.

How to reproduce

  1. /tp ~ ~ ~ -1 ~

  2. /testfor @p[rym=10]
    It finds you although it claims your yaw is -1.

Edit: This seems to take only effect when ry is not specified

Linked issues

Attachments

Comments 15

if I use negative ones, it works fine for me

I added steps to reproduce it

if you use rym, you also need to use ry, that's intended

so, use @p[rym=10,ry=90]

You do not have to use ry it defaults to 359 if it is not set.
However what I am saying is that the /tp command and the debug window show the rotation from -180 to 0 to 180 whereas the rx / ry parameters using this range: 180 to 359 | 0 to 179.

5 more comments

Also made some tests.

/execute @e[type=ArmorStand,ry=-90,rym=90] ~ ~ ~ /setblock ~ ~2 ~ minecraft:stone

works the same as

/execute @e[type=ArmorStand,ry=270,rym=90] ~ ~ ~ /setblock ~ ~2 ~ minecraft:stone

@@unknown: You are right. I updated the report. It seems to happen only when the maximum argument is not provided.

@@unknown: /execute @e[type=ArmorStand,ry=-90,rym=90] ~ ~ ~ /setblock ~ ~2 ~ minecraft:stone would make no sense as the minimum argument is higher than the maximum arugment. But due to this bug it might work.

Could you both or at least FVbico please try to reproduce the bug with the given command?

It makes sense, if you count rotation as circle. ry=-90,rym=90 means an arc from +90 up to 180, and from -180 to -90 (it will count something like C ). Remember that -180 is equals to 180. It is opposite of arc from -90 to +90 (something like Ɔ).
Default value of ry and rym is 0+n*360, where n is integer.
When you select ry=10, it means <0,10>
when you select rym=10 it means <10,360>
You can check it by summoning armorstand, setting it rotation to 365, and testing if it has 0-10 degrees. It will be found.
To explain, attached image.
It doesn't matter if you are using 50', -310' or 410', all of them are the same (represented by green line). It counts to the right from rym, and to the left from ry.
Interesting behavoiur is when you choose rym=0,ry=360. It will count only ry=0, not full circle. The same for rym=-180,ry=180 it will find only 180/-180, but for example 30 will not be found. It is because both lines (green and red) are on the same spot it this examples.
So... in my opinion this is not a bug, but WAI.

It is still kind of strange that it supports degrees from 0 to 360 and from -180 to 180 at the same time...

This is basic geometry. There is no ambiguity, so it should not be surprising that it can accept multiple values that map to the same angle. I see no bug here, and the debug screen isn't meant for player use anyway. It's a developer tool, and shows the information that developers find useful, in a format that the developers find useful.

marcono1234

(Unassigned)

Unconfirmed

debug, debugscreen, rotation, rx, rxm, ry, rym

Minecraft 15w41b

Retrieved