'Execute' not performing command preceeded by 'run' in 1.13
In 1.12, I had the command:
execute @a ~ ~ ~ teleport @s ~ ~ ~
In a 'repeat' command block. This would freeze all players until I chose to unfreeze them. In 1.13, I assumed the adjustment to this syntax would be:
execute at @a run tp @s ~ ~ ~
In a 'repeat' command block. However, this does not work. To attempt to debug, I tried:
execute at @a run give @s stone 1
Still to no avail. I also tried replacing the selector in the run part:
execute at @a run give @p stone 1
And nothing. Could someone point me in the right direction?
You're not changing the executor (only the command position), so @s
is targeting nobody. You can execute the command as the player like this:
execute as @a at @s run tp @s ~ ~ ~
In addition, relative teleports will no longer stop motion. Absolute teleports and teleports to entities still do though, so you could do:
execute as @a run tp @s @s
Note also that I've removed the at @s
, since relative coordinates aren't being used anymore so it's no longer needed.