I've been trying to create a command block where the player places down a spawn egg and they will be teleported in front of them. I have already figured out the spawn egg part but I can't figure out the teleport part. (Also the spawn egg is a chicken)

  • so do they teleport to where the thing spawns? or just 5 blocks ahead no matter where it spawns?
    – Topcode
    Commented Dec 30, 2020 at 19:18
  • 5 blocks ahead no mater where it spawns Commented Dec 30, 2020 at 19:19

1 Answer 1


Your command is the following.

execute as <selector> at @s run tp ^ ^ ^5

That will teleport you 5 blocks in front of you. The ^ are used for cords relative to what your head rotation is. The first ^ is for left/right. The second is for up/down(positive being up and negative being down). The last one is for forward/backward(positive being forward and negative being backward). Remember, these are relative to what your head rotation is. Make sure to execute the to command as the entity you want to tp.

  • I had to switch @s to @p though because @s wouldn't work. Commented Dec 30, 2020 at 19:25
  • @darthvader1925 if you replaced <selector> with your selector like @a it should have been fine. Commented Dec 30, 2020 at 21:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .