1

How do i make a command trigger in a area?

NaticGlacier's Avatar NaticGlacier1/19/20 1:03 pm
1/19/2020 11:13 pm
NaticGlacier's Avatar NaticGlacier
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.
Posted by NaticGlacier's Avatar
NaticGlacier
Level 1 : New Crafter
0

Create an account or sign in to comment.

12

1
01/19/2020 10:37 pmhistory
Level 1 : New Crafter
NaticGlacier
NaticGlacier's Avatar
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.
1
01/19/2020 8:01 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
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>
1
01/19/2020 7:30 pm
Level 33 : Artisan Pixel Painter
ChorusCraft
ChorusCraft's Avatar
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
01/19/2020 8:02 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
dx,dy and dz are not needed. They're to find entities in a 3d volume from the coords of x,y,z
1
01/19/2020 8:33 pm
Level 33 : Artisan Pixel Painter
ChorusCraft
ChorusCraft's Avatar
Actually, try doing /execute as @a[​x=-15,y=61,z=-116,distance=2] at @s say hello, hope that'll work.
1
01/19/2020 10:36 pm
Level 1 : New Crafter
NaticGlacier
NaticGlacier's Avatar
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
01/19/2020 10:50 pm
Level 33 : Artisan Pixel Painter
ChorusCraft
ChorusCraft's Avatar
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
01/19/2020 11:13 pm
Level 1 : New Crafter
NaticGlacier
NaticGlacier's Avatar
so how do i find DX, DY, and DZ sorry i'm new to command blocks
1
01/19/2020 10:24 pm
Level 1 : New Crafter
NaticGlacier
NaticGlacier's Avatar
no it does not work sadly
1
01/19/2020 8:43 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
at @s wont do anything for say. It only determines stuff like /setblock and /summon
1
01/19/2020 7:26 pmhistory
Level 15 : Journeyman Miner
icephantom
icephantom's Avatar
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.
1
01/19/2020 8:03 pm
Level 52 : Grandmaster Blob
HoboMaggot
HoboMaggot's Avatar
1.13 made that function accessible in 1 command.
Thats why 1.13 command changes were revolutionary
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome