How to spawn an entity behind another entity based on where it is facing



  • I am wondering how to spawn an entity behind another one but it does it based on where the entity is facing



  • Use the new caret notation. Tildes (~ ~ ~) use global positioning and carets (^ ^ ^) use local positioning. So the command looks like this:

    /execute as  at @s run summon  ^ ^ ^-1
    

    The first caret is for left and right, the second one is for up and down, and the third one is for forward and backward. So ^ ^ ^-1 means 1 block behind the entity (regardless of its rotation).




Suggested Topics

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