1
How do i make a command trigger in a area?
I set the command in the block to Execute if entity @a[x=-15,y=61,z=-116,distance=2] run say [you] hello.
and when i go to the location to test it the command doesn't activate. i went back to the command block it says test failed. i don't know what i'm doing wrong the block is always set to active. My game version is in 1.15.1
I tried going back to other versions of Minecraft and seeing if its just the version i'm playing on and i'm still having the same issue.
and when i go to the location to test it the command doesn't activate. i went back to the command block it says test failed. i don't know what i'm doing wrong the block is always set to active. My game version is in 1.15.1
I tried going back to other versions of Minecraft and seeing if its just the version i'm playing on and i'm still having the same issue.
Create an account or sign in to comment.
12
1
Update: here is what i have type in to the command block and where it's at imgur.com/a/U7zdsYW
Also the only way i can get it to work is when i remove distance and change the command block to repeat but it wont stop. i tried with impulse it works only once.
Also the only way i can get it to work is when i remove distance and change the command block to repeat but it wont stop. i tried with impulse it works only once.
1
Its not the version. The selector syntax is the same since 1.13.
The reason I can think of, is you're more than a block away from that block.
distance=2 actually means 1 block radius, from the target block. So if you want a 10 block radius, its distance=11.
Also if you want the player to say hello, its /execute as <rest>
The reason I can think of, is you're more than a block away from that block.
distance=2 actually means 1 block radius, from the target block. So if you want a 10 block radius, its distance=11.
Also if you want the player to say hello, its /execute as <rest>
1
You probably forgot to add in the dx, dy, and dz. Add those in as dx=0, dy=0, dz=0 and I believe your command will work.
1
dx,dy and dz are not needed. They're to find entities in a 3d volume from the coords of x,y,z
1
Actually, try doing /execute as @a[x=-15,y=61,z=-116,distance=2] at @s say hello, hope that'll work.
1
If you wondering what i put in the command block is at and what i have typed in here is the pictures imgur.com/a/U7zdsYW
1
You can't do execute if entity @a[x=-15,y=61,z=-116,distance=3] or else the command block won't work. You have to write execute as @a[x=-15,y=61,z=-116,dx=0,dy=0,dz=0] because the command block needs to know who's on x=-15, y=61, and z=-116. You also have to put in dx, dy, and dz otherwise the command won't get the player in that position. Hope you get what I'm saying.
1
so how do i find DX, DY, and DZ sorry i'm new to command blocks
1
no it does not work sadly
1
at @s wont do anything for say. It only determines stuff like /setblock and /summon
1
Not sure of the 1.15.x way, however, how I used to do this, I needed 2 command blocks. The first one would have a command like :
/testfor @a[r=3]
........ this would test for players within a radius of 3 from the command block. I would have a [minecraft:comparator] next to thie first block which would send out a redstone signal as soon as the command was true to the second block which would have the second command in it.
The comands may have moved on in 1.15, I've not checked, however, in previous versions, you couldn't do multiple commands within a single block like you are trying to do, hence using a comparator to activate the second block and the second command.
/testfor @a[r=3]
........ this would test for players within a radius of 3 from the command block. I would have a [minecraft:comparator] next to thie first block which would send out a redstone signal as soon as the command was true to the second block which would have the second command in it.
The comands may have moved on in 1.15, I've not checked, however, in previous versions, you couldn't do multiple commands within a single block like you are trying to do, hence using a comparator to activate the second block and the second command.
1
1.13 made that function accessible in 1 command.
Thats why 1.13 command changes were revolutionary
Thats why 1.13 command changes were revolutionary