mojira.dev
MC-121726

Only players can teleport with relative coordinates

With the snapshot, containing the Brigadier Command-System, it is not (easily) possible, to teleport (non-player) entities relative anymore.

I am aware, that the old behavior of the tp command is non-existent anymore and that

tp @e ~ ~1 ~

teleporting all entities (including yourself) above yourself is correct, instead of teleporting every entity up relative to itself.

However, doing this with execute is not possible either in the snapshot:

execute as @e at @s run tp ~ ~1 ~

or

execute as @e at @s run tp @s ~ ~1 ~

Which is in my eyes the way to do it, will give an error message, that a relative teleport requires a player to run.

Therefore the only possible way of doing a relative teleport on something, that isn't a player currently, is by summoning a temporary entity and teleporting to that.

In my eyes, it is a bug, that a relative teleport requires a player as an executor.

Comments 6

You need to provide which entities should teleport.

If you mean as in
execute as @e at @s run tp @s ~ ~1 ~
then this does not work either and yields the same error.

Okay after some playing around, it does work, if you still have a player as the executor and only change the position as in:
execute at @e[type=armor_stand] run tp @e[type=armor_stand] ~ ~1 ~
but the fact, that it requires a player is just an unnecessary annoyance in my opinion...

Also, in order for multiple armor stands not to bunch up, you have to use /execute at @e[type=armor_stand] run tp @e[type=armor_stand,distance=0] ~ ~1 ~

Yeah, it was only an example. Kinda kills of the huge efficiency-gain we got with the @s selector... I really hope this gets changed, and if not I really would love to hear the reason for it, as I do not see a reason for not doing it right now

This somehow got fixed in 17w45b... I don't know how it happened, but

execute as @e at @s run tp @s ~ ~1 ~

does indeed work now.

Still don't see a reason, why tp ~ ~1 ~ without a selector requires a player, but I can live with having to write @s

Possseidon

(Unassigned)

Unconfirmed

Minecraft 17w45a

Minecraft 17w45b

Retrieved