When trying a command to place a block 3 blocks ahead of where a player is facing the command block instead will create the block 3 blocks in the direction the command block is facing. If the player executes the command in their own chat the command will function correctly and place the block where the player is facing.
/execute as @a [ tag = Hider ] positioned as @s positioned ^ ^1 ^3 positioned ^ ^ ^ run /setblock ~ ~ ~ light_block 9 keep
Comments 4
It works when executed from the chat log and it will place the block where the player is facing. But command blocks will execute it from the player but in the direction the command block is facing. The ^ ^ ^ part of the command is only applying to the command blocks direction and not the players even though it should be executing from the player.
/execute as
does not apply any changes to the rotation context of the command. You must use /execute at
or /execute rotated as
to supply a change to the rotation. These are both valid implementations, although I recommend the former.
/execute as @a at @s run setblock ^ ^1 ^3 light_block 9 keep
/execute as @a positioned as @s rotated as @s run setblock ^ ^1 ^3 light_block 9 keep
Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response.
Does the command function as expected when it is instead written like this?
This ticket will automatically reopen when you reply.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📓 Project Summary – 📧 Suggestions – 📖 Minecraft Wiki