1

I'm making a map and I'm trying to separate players by building a wall when ever one crosses a certain point, but I can't seem to get the command block to detect when i'm on something and build a wall.enter image description here

I want each person to go a seperate way

enter image description here

I realize I didn't give enough info so I made this image. The coordinates represent the blocks themselves not the air.

2

Note: I only noticied that it's the bedrock version as I was finishing this answer. Apologies if it does not work since I can't test myself. I read the wiki and it theoretically should work.


The execution is pretty simple. Since you didn't give me real valeus, I'll try to show it using your screenshot and will be considering the direction you are facing as north, which means foward will decrease Z and to the left will decrease X.

You want to execute as someone within the black grid range and 2-3 block above.

To do that, I'm going to be using the target selector with 'x' and 'dx' (as well for 'y' and z'). 'x' stands for the coordinates on the X axis and 'dx' stands for the distance, using the previus 'x' value

/execute as @a[x=purple.x,dx=3.9,z=purple.z,dz=1.4,y=purple.y+1,dy=3] at @s run fill blue.x blue.y+1 blue.z darkblue.x darkblue.y darkblue.z minecraft:block

Consider color.axis the coordinates for the painted block and y+1 is the block Y axis +1 (So for instance, if it is 6, you will use 7)

This will build a wall made of 'block' starting from the block above the light blue color and until the dark blue one, filling up the whole area.

Apply the same setup on the other side.


Considering the coordinates given, this will be the command:

/execute as @a[x=-44,dx=2.4,z=223,dz=-3.4,y=5,dy=3] at @s run fill -40 5 223 -40 8 219 torch

Change "torch" to any block you want.

  • Thanks for quick response wasn't expecting one this early, but I didn't really get what you said and I should've given more info. So I added another picture and if you could help again that would be really great! – Aidan Jardine Sep 22 '19 at 2:19
  • I'll be doing it tomorrow, since it's way past midnight. I should be have all ready in about 14 hours from this comment post time. – Bruno Rodrigues Sep 22 '19 at 3:30
  • Just edited it, @AidanJardine . Have fun! – Bruno Rodrigues Sep 22 '19 at 19:35
  • Hi used the the new code it worked with just minor adjustments because bedrock is a little different, anyway thanks for all the help! – Aidan Jardine Sep 22 '19 at 20:55
  • Could you tell me the difference? I want to learn a little about bedrock. – Bruno Rodrigues Sep 22 '19 at 21:20
0

First, go to settings and turn on show coordinates.
Second, go to the block you want it to detect players on and then place your persons legs on that block and write down your coordinates.
Third, type in this command with the coordinates you got in the place the random coordinates I chosen like this : /testfor @p 1200 360 -100.

  • 1
    Hey, welcome to Arqade SE. While this may work, you should add more information about how this work. How could the OP effectively use it for example? Or how could the OP use the result of this code to build his wall? – Zoma Sep 23 '19 at 7:34

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.