Teleporting an entity behind a player?



  • 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] ^ ~ ^
    


  • 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  rotated ~ 0 run tp @e[tag = clone] ^ ^ ^-1
    

    If 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 and /tp the entity to its relative position with relative rotation:

    execute at  rotated ~ 0 run tp @e[tag = clone] ^ ^ ^-1
    

    execute as @e[tag = clone] at @s rotated as run tp @s ~ ~ ~ ~ ~




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2