Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-276704

Not using a selector in a tp command breaks rotation from a completely different tp command

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w38a
    • 24w37a
    • None
    • Community Consensus
    • Commands
    • Important
    • Platform

      a teleport command which doesn't affect rotation at all makes the following teleport commands give the entity different rotation values depending on whether the original tp command uses the @s selector, or no selector at all.

      Steps to reproduce:
      -Download the example datapack
      -Run /execute positioned 0.0 0.0 0.0 summon minecraft:marker at @s rotated 0 -50 run function example:test1
      -Run /execute positioned 0.0 0.0 0.0 summon minecraft:marker at @s rotated 0 -50 run function example:test2
      -Compare the Rotation values given by the /tellraw command

      Expected Behavior:
      Using an @s selector vs not using a selector wouldn't affect the rotation resulting from a completely different teleport command (Just like it worked in 1.21.1)

      Observed Behavior:
      The difference between using an @s selector vs not using one is visible through the entity's rotation

      /data/example/test1.mcfunction -> gives a Rotation[1] value of 89.99999f (expected value)

      tp @s 0.0 0.0 0.0
      tp @s ~ ~10 ~
      execute at @s facing 0.0 0.0 0.0 run tp @s 0 0 0 0 ~
      tellraw @a {"entity":"@s","nbt":"Rotation[1]","color":"green"}

      /data/example/test2.mcfunction gives a Rotation[1] value of 40.0f (it seems to always add 90° to the rotation given in execution context)

      tp 0.0 0.0 0.0
      tp @s ~ ~10 ~
      execute at @s facing 0.0 0.0 0.0 run tp @s 0 0 0 0 ~
      tellraw @a {"entity":"@s","nbt":"Rotation[1]","color":"green"}

        1. image-2024-09-15-23-31-14-794.png
          49 kB
          BugTracker

            HugoHagglund [Mojang] SHugoh
            nedraw nedraw
            Votes:
            8 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: