Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-160213

Local coordinates do not work properly in functions

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • 1.19.20.24 Preview, 1.19.11 Hotfix
    • None
    • Plausible
    • Multiple

      Summary

      Local coordinates do not work properly in functions.

      How to reproduce

      1. Make a behavior package that contains a function named Test
      2. In function Test write "execute @s ~ ~1.5 ~ summon armor_stand ^ ^ ^5"
      3. Load the behavior pack in the cheat enabled archive
      4. Enter the game save
      5. Change your character's orientation in the game
      6. Run the command "/function Test" in the chat bar
      7. Repeat Step 5 to Step 6 for multiple times

      Expected Results

      Armor stands are spawned 5 blocks in front of you.

      Observed Results

      No matter how you change the orientation, the armor stand is spawned in one place.

      Note

      The BDS server is not affected.

      If your horizontal orientation is ry and your vertical orientation is rx, and you are currently at (x,y,z), then after executing that function, the armor stand should be spawned at this position:

      ( -5*cos(rx)*sin(ry)+x , -5*sin(rx)+y+1.5 , 5*cos(rx)*cos(ry)+z )

            eternity_hope Happy2018new
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: