How to build wall with Minecraft fill command and caret notation?

Here is the problem with your command. GeoGebra Drawing Let's say you run the command while facing the solid green line shown on the page. On a computer, that's where your crosshairs are (so the green line represents the line segment between your head and your crosshairs)

Now, when facing straight, and not up or down, the crooked lines would align with the axes shown in the image. But when you are not facing straight forward, the direction of forward, backward, up, and down will change.

That means that ^0 ^1 ^1 will reference a point one unit along the FORWARD line, and one unit right along the red axis. This means that diagonal movements are allowed, which means that forward will mean slightly up as well.
It gets even worse with the second set of coordinates. You entered: ^1 ^20 ^10. This means one block right. Not a problem, but when you then do 20 blocks upwards, it means 20 blocks on the UP line in the picture. If you are facing the same way, it means slightly backwards as well!

In Java Edition, a fix exists, by using the rotated subcommand of the /execute command. Here is a command that would work in Java Edition:

/execute rotated 0.0 0.0 run fill ...

Unfortunately, this fix does not exist in Bedrock Edition.

I understand that this may be confusing to understand. If you require further explanation, just comment below! Either way, I hope this answer has shown you the dangers of diagonal movements with caret ^ notation.


You need to use ~ instead of an ^. Based on the engine of Minecraft, it seems like Minecraft cannot create diagonal walls using commands, so it "freaks out" and makes a solid block that is ~10 blocks long diagonally. This means that you should use ~, rather than ^.

So, the command should be this:

/fill ~ ~ ~ ~ ~20 ~10 stone

In the case you were wondering, a ~ means that the position of the wall is relative to the position of the player or command block executing it. Contrarily, the symbol ^ means that a command is executed relative to the direction of the player or command block.

I hope this helps.