mojira.dev
MC-278673

The x-rotation of /teleport is limited to ±90 degrees relative to the entity's original angle

Summary:
Starting from version 1.21.2, the x-rotation in the /teleport command, when rotated using relative angles, is clamped to within ±90 degrees of the entity's original x-rotation.

This bug may cause existing datapacks to malfunction.

The red sector in the attached image represents the range of possible rotation.
In version 1.21.1 and earlier, the range of rotation was from directly above to directly below.
However, starting from version 1.21.2, if the initial angle is -70°, the x-rotation can only be lowered to 20°.

 

Steps to reproduce1:
Execute the following two commands in the chat box.

/tp @s ~ ~ ~ ~ -70
/tp @s ~ ~ ~ ~ ~120

Expected results1:
The player's x-rotation will be set to -70+120 = 50{}.

Observed results1:
The player's x-rotation will be set to 20.

 

Steps to Reproduce2:

  1. Place an armor stand in the world.

  2. Make the player's orientation face directly downward, and execute the command: teleport @n[type=armor_stand] ~ ~ ~ ~ ~. This will set the armor stand to the same position and orientation as the player.

  3. Next, make the player's orientation face directly upward and execute the same command again: teleport @n[type=armor_stand] ~ ~ ~ ~ ~.

Expected Results2:
The armor stand should face directly upward, matching the player's orientation.

Observed Results2:
Instead of facing the same direction as the player, the armor stand ends up oriented horizontally.
 

Note: This issue does not affect the /rotate command.

Attachments

Comments 2

Of course, I am aware of that change.
However, I interpreted the description to imply clamping within the absolute range of -90 to 90 degrees.
I understand the necessity of restricting the entity's angle to ensure it remains within a valid orientation range of -90 to 90 degrees, but is it truly necessary to impose a limit on the angle for a single rotation of the entity?

For example, if you are looking straight down and execute

/tp @s ~ ~ ~ ~ ~-180

you would expect the user to look straight up, but in reality they will stop in front of you.

The Rotate command seems to make them look straight up without any problems

/rotate @s ~ ~-180

komaramune

Shugoh

Confirmed

Platform

Important

Commands

1.21.4

25w03a

Retrieved