Hey guys, I'm trying to make this 1.12 command work in 1.13. I put the 1.13 command in a repeating command block, but it never works. However, if I copy paste it and execute it myself from the chat it works just fine. Does anyone know why this is?
The way the distance field works has been changed. When you write
distance=1
it only targets things exactly one block away. You will need to use
distance=..1
to target things in the range of up to 1 block away from the place you specified.
Also, I don’t know if this is intended or not, but be careful with the second @a you put in your execute command, I think you meant to make your entire command execute as... and then you could just do tp @s...
It still isn't working in the command blocks, but if I put it in chat, it works.
I have these two commands in a repeating, then chain command block: Repeating: execute at @a[x=-19.5,y=100,z=-113.5,distance=..1] run tp @s ~ ~6 ~
Chain: execute if entity @a[x=-19.5,y=106,z=-119.5,distance=..1] run tp @s ~ ~-4 ~-4
I'm not sure what I'm doing wrong, the only thing that I could think of is to increase the distance from ..1 to 1..15 (X,Y,Z is 15 blocks from command block) to see if distance means how far the entity is from the command block but that didn't work either. Any ideas?
Thanks.
Edit: /execute at @a run tp @s ~ ~6 ~ does not work either in command blocks, but only in chat. So that means that the selector ([x=-19.5,y=100,z=-113.5,distance=..1]) is fine, but it is the teleport that doesn't work. Anyone know why?
Edit: Nvm all that I just had to change some quardinates, and for some reason command blocks don't like the @s selector so I just used the @a selector :/
If you want to use the @s selector, you have to use as and then the @a[...], like this (using the above coordinates as an example):
execute as @a[x=19.5,y=100,z==113.5,distance=..1] at @s run tp @s ~ ~6 ~
The as makes it so the entities at that location run this command, and the at is so that with the relative coordinates the entity is running that command at their location as opposed to the command block's location.
Hey guys, I'm trying to make this 1.12 command work in 1.13. I put the 1.13 command in a repeating command block, but it never works. However, if I copy paste it and execute it myself from the chat it works just fine. Does anyone know why this is?
1.12: /execute @a[x=X,y=Y,z=Z,r=1] ~ ~ ~ tp @a ~6 ~5
1.13: /execute at @a[x=X,y=Y,z=Z,distance=1] run tp @a ~6 ~5 ~
(I know the /execute part is not required and I could just write it as /tp @a[x=X,y=Y,z=Z,r=1] ~6 ~5 ~)
Thanks for any help.
The way the distance field works has been changed. When you write
it only targets things exactly one block away. You will need to use to target things in the range of up to 1 block away from the place you specified.Also, I don’t know if this is intended or not, but be careful with the second @a you put in your execute command, I think you meant to make your entire command execute as... and then you could just do tp @s...
It still isn't working in the command blocks, but if I put it in chat, it works.I have these two commands in a repeating, then chain command block:Repeating: execute at @a[x=-19.5,y=100,z=-113.5,distance=..1] run tp @s ~ ~6 ~Chain: execute if entity @a[x=-19.5,y=106,z=-119.5,distance=..1] run tp @s ~ ~-4 ~-4I'm not sure what I'm doing wrong, the only thing that I could think of is to increase the distance from ..1 to 1..15 (X,Y,Z is 15 blocks from command block) to see if distance means how far the entity is from the command block but that didn't work either. Any ideas?Thanks.Edit: /execute at @a run tp @s ~ ~6 ~ does not work either in command blocks, but only in chat. So that means that the selector ([x=-19.5,y=100,z=-113.5,distance=..1]) is fine, but it is the teleport that doesn't work. Anyone know why?Edit: Nvm all that I just had to change some quardinates, and for some reason command blocks don't like the @s selector so I just used the @a selector :/
Glad you got it working!
If you want to use the @s selector, you have to use as and then the @a[...], like this (using the above coordinates as an example):
The as makes it so the entities at that location run this command, and the at is so that with the relative coordinates the entity is running that command at their location as opposed to the command block's location.
That would make sense, thank you!