Rotation NBT has inconsistent wrapping
Assuming a scoreboard objective rotation with type dummy, if the command execute as @a at @s store result score @s rotation run data get entity @s Rotation[0] is ran in an Always Active repeating command block, it is expected that the Vertical Rotation of each player will be set to their rotation score. This does occur, but it is inconsistent, ranging from -360 to 359
I believe this happens due to Rotation NBT not actually capping it's value, instead the value being given to rotation is the result of Rotation % 360 where % is modulus and Rotation >= 0. This isn't the worst thing, but the issue arises when Rotation NBT is negative and rotation then is given the value of Rotation % -360. Rotation NBT seems to not have a cap (and is inconsistent when being translated to rotation because if you continually rotate clockwise (angle is increasing), rotation will loop from 0 to 359. If you rotate from 0 to 720 (two full rotations), it then takes 2 rotations back (720 to 0) to begin getting a negative rotation score.
2017-11-11, 06:25 PM
2023-10-26, 07:42 PM
15
14
-