Forumskeyboard_arrow_right Help keyboard_arrow_right Java Edition

Create Forum Thread
1

How do i make a command trigger in a area?

1 emeralds12 replies70 views
created 01/19/2020 1:03 pm by NaticGlacier
last reply 01/19/2020 11:13 pm
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 avatar
NaticGlacier
Level 1 : New Crafter
0

comment Login or register to post a reply.

12 replies

1
01/19/2020 10:37 pmhistory
Level 1 : New Crafter
NaticGlacier
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 20 : Expert Unicorn
HoboMaggot
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 32 : Artisan Magical Boy
TheChorusFruit
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 20 : Expert Unicorn
HoboMaggot
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 32 : Artisan Magical Boy
TheChorusFruit
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
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 32 : Artisan Magical Boy
TheChorusFruit
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
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
no it does not work sadly
1
01/19/2020 8:43 pm
Level 20 : Expert Unicorn
HoboMaggot
at @s wont do anything for say. It only determines stuff like /setblock and /summon
1
01/19/2020 7:26 pmhistory
Level 3 : Apprentice Miner
icephantom
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 20 : Expert Unicorn
HoboMaggot
1.13 made that function accessible in 1 command.
Thats why 1.13 command changes were revolutionary
Planet Minecraft Logo

Website

© 2010 - 2020
www.planetminecraft.com

Welcome