TransWikia.com

How do I teleport a player to another entity while changing the player's rotation?

Arqade Asked on December 3, 2021

I want to be able to teleport to an entity but keep my original rotation?
I tried /tp @p @e[type=ArmorStand] ~ ~.
I have looked everywhere and tested even the most stupid lines of code, in hope I’d stumble upon a working one.
Any help would be appreciated 🙂

2 Answers

(for 1.13+)

What I have found is:

/execute at @e[type=pig] as @e[pig,limit=1,sort=nearest] run tp @s @p

Seems to teleport the entity while keeping the player's rotation. (teleports entity with the player's original rotation)

Answered by Anime_Watcher2 on December 3, 2021

When teleporting a entity to another, you cannot change the rotation. (There is no way to achieve this in a single command)

/tp @p @e[type=ArmorStand]

However, if you make this command run right after/before the teleportation to the armor stand, you can achieve the same effect.

/tp @p ~ ~ ~ <x rotation> <y rotation>

(Teleports the person who uses this command nowhere, then changes his rotation, or vice versa.)
Clue: Try making the armor stand execute this command.^

^ Since you're using @p, it does not affect the armor stand.

Answered by aytimothy on December 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP