mojira.dev
MC-136534

All command blocks think they're facing south with caret notation

The bug

When using Caret notation (^a ^b ^c), Command blocks always "face" south no matter what their "facing" data is set to.

This is almost more like a feature request than a bug, but I do think the behavior is slightly unexpected. it works fine if you're using Execute or any command that involves an entity, but if you're using a command that doesn't use an entity, there's no facing vector for use in ^-notation, so it defaults to south.

How to reproduce

  1. Create a command block with facing:east 

  2. Set its command to "/setblock ^ ^ ^1 stone"

  3. Power the command block

  4. Unlike an entity performing the command, instead of placing the block one space to the east, it will place it one block to the south

Reasoning

  1. It makes intuitive sense that a command block should use its facing vector for caret positioning. 

  2. It makes it easier to build systems that require caret positioning because you can point the block in the direction you'd like to effect

  3. Some constructs become less direction-dependent. when recreating a command block structure that uses this feature, you don't need to worry about what rotation you've built the machine

Linked issues

Attachments

Comments 13

In previous versions, the command would simply fail.

It's not really possible to entirely define the local coordinate system using only six directions. Consider an upwards facing command block with the command /setblock ^ ^1 ^ stone – where would the block logically go?

I had to think a little bit about this one, but I understand the question now. I would assume an upward facing command block would have a position/rotation of ~ ~ ~ 0 -90 and a downwards facing command block to be ~ ~ ~ 0 90 so we assume it's "facing" south and looking upwards/downwards. ^x follows the old x axis, ^y follows the old z axis, and ^z follows forwards on the old y axis. similarly down is the same way but ^y and ^z are inverted because of the view angle

 

That is a good question though, and I can see why that might cause confusion for users on first encounter

and it definitely throws a wrench into the "non-directionality" of the idea. I guess I was only thinking about it in the case of using the forward vector (^z) so I didn't see that problem before

Confirmed for 1.13.2-pre1.

Confirmed for 1.13.2-pre2.

Caret notation that obeys the command block orientation would make it possible to build contraptions that can be cloned and rotated via structure blocks without having to re-write the commands to account for the new orientation of the contraption.

3 more comments

Can confirm in 21w06a.

Can confirm in 1.16.5 and 21w08b.

Can confirm in 1.17.1

Can confirm in 1.18.2 and 22w18a. As an easier method od reproduction, simply execute the command provided below.

/setblock ~ ~ ~3 minecraft:repeating_command_block{Command:"setblock ^ ^ ^1 minecraft:stone",auto:1b}

Can confirm in 1.19.2.

Kavukamari

slicedlime

Confirmed

Commands

Minecraft 1.13.1, Minecraft 1.13.2-pre1, Minecraft 1.13.2-pre2, Minecraft 1.13.2, Minecraft 18w48a, ..., 21w08b, 1.17.1, 1.18.2, 22w18a, 1.19.2

23w03a

Retrieved