1

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?

EDIT: Removed pointless conditions in selectors.

2

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.

  • Does that not run the command as @a? What if @a doesn't have permission to use /tp? – Xav Jul 18 '18 at 19:03
  • Also, this does not have the same behaviour as the command I listed in 1.12. In 1.12, the command would freeze a player in the spot they were standing in at the time the command began execution. This does not do that – Xav Jul 18 '18 at 19:05
  • @Xav It doesn't use permission level of the player being executed as, it uses the permission level of the command block. – SirBenet Jul 18 '18 at 19:05
  • @Xav Ah true, relative TPs no longer stop motion. I've updated the answer with a command that should stop motion. – SirBenet Jul 18 '18 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.