I would like to build a 10 x 20 wall (10 blocks long, 20 blocks high) in front of the user's player.

I tried to use the following command -

fill ^0 ^1 ^1 ^1 ^20 ^10 stone 

But in result, I get 'filled 892 blocks'. What is wrong with my command?

I ran the command second time, it is 592 blocks now - 592 blocks image

  • Why is Filled 892 blocks not the result you are expecting? Is the wall malformed after running the command? – ExpertCoder14 Jun 11 at 19:16
  • So is the wall deformed, (i.e. diagonal)? Perhaps that may be causing the extra 692 blocks. However, I am still confused about how an extra 700 blocks could be put into a command that should form a 200-block volume wall. Could you include a screenshot of the wall? – fasterthanlight Jun 11 at 21:08
  • @fasterthanlight, I've added the screenshot. It is 592 blocks now... – LA_ Jun 12 at 14:07
  • Were you facing straight (pointing N, S, E, W) when you ran the command? – fasterthanlight Jun 12 at 14:20
  • @fasterthanlight, no, I don't think so - the direction was random. – LA_ Jun 12 at 18:25

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.

| improve this answer | |
  • Thanks. Looks like I can rotate the player before building a wall with ^ notation. But I don't know how to get player's current rotation :(. – LA_ Jun 21 at 8:37
  • Unfortunately, this is currently impossible in Bedrock Edition. I'm afraid you may not be able to detect player rotation. Sorry! – ExpertCoder14 Jun 21 at 15:32

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.

| improve this answer | |
  • Thanks. I understand how ~ works, I want to build a wall taking into consideration the direction of the player. – LA_ Jun 11 at 18:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.