Teleporting an entity behind a player?
By Sarah Scott •
I am trying to make a morph command with command blocks but whenever I try to use ^ the mob just moves up and down when I try to move my camera. I can't figure out how to get the head to move while I have an offset.
For example, something like:
execute at USERNAME run tp @e[name=clone] ^ ~ ^ 1 1 Answer
You can use rotated ~ 0 to essentially ignore the pitch of the player when teleporting the entity ^ ^ ^-1 (1 block behind, or any desired offset) the player so that it does not move up or down whenever the player looks up or down.
Here's an example:
execute at <player> rotated ~ 0 run tp @e[tag = clone] ^ ^ ^-1If you still want the entity to look up or down if the player looks up or down, you can execute as and at the entity that has the clone tag, use rotated as <player> and /tp the entity to its relative position with relative rotation:
execute at <player> rotated ~ 0 run tp @e[tag = clone] ^ ^ ^-1
execute as @e[tag = clone] at @s rotated as <player> run tp @s ~ ~ ~ ~ ~ 3