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

Caret notation in execute command is treated as tilde notation in functions.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • 1.16.10, 1.16.221 Hotfix
    • None
    • Unconfirmed
    • Multiple

      THE BUG

      When using the caret notation in functions (eg. execute @a ^ ^ ^), it is treated as tilde notation. The command "execute @p ^ ^ ^10 tp @e[type=cow] ~ ~ ~" should teleport all cows in front of the player. This command works correctly when using command blocks but when used in functions, it moves the cows to the south of the player instead.  If the command "execute @a ^ ^ ^5 tp @e[type=cow] ~ ~ ~" is typed into a command block,  all the cows will teleport 5 blocks in the direction the player is looking. This is the intended result.

      A work around this would be this command: "execute @p ~ ~ ~ tp @e[type=cow] ^ ^ ^10". This works exactly as the command "execute @p ^ ^ ^10 tp @e[type=cow] ~ ~ ~". I briefly tested it and the work around is applicable to other commands other than spreadplayers. Kindly test this work around for further information. I have attached a behavior pack for further testing.

       

      HOW TO REPRODUCE

      The Bug

      1. In a .mcfunction file, type "execute @a ^ ^ ^5 tp @e[type=cow] ~ ~ ~". Then save the function as 'test'. The behavior pack for download contains the function too.
      2. . Make a behavior pack containing the function. 
      3. Load in the behavior pack.
      4. Place a command block and input in the command 'function test'.
      5. Set the command block type to Repeat and redstone to Always Active.
      6. All cows will teleport 5 blocks south of the player instead of where to players is looking.

       The Work around

      1. In a .mcfunction file, type "execute @a ~ ~ ~ tp @e[type=cow] ^ ^ ^5". Then save the function as 'test'. The behavior pack for download contains the function too.
      2. Follow the instructions 2-3 from above.
      3. Place a command block and input in the command 'function workaround'.
      4. Set the command block type to Repeat and redstone to Always Active.
      5. All cows will teleport 5 blocs in front of the player.

            Class_Magicker Ross David Tan
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: