How would I make a teleport command happen once with a repeating command block?

by EarthToAccess   Last Updated April 15, 2019 07:14 AM

I'm attempting to make a world that is similar to a server SMP, except it's run solely on command blocks. Currently, I want to set up a way where, when you spawn, you spawn facing a specific direction. (This is, of course, up until you sleep to reset your spawnpoint.)

The problem is this; I've already made a basic execute command that teleports people and gives the illusion of looking in one direction (specifically, -Z diagonal), but I can't find a way to make it so it only occurs once unless they die without setting a different spawn point elsewhere. My current command is this:

execute as @a[x=X,y=Y,z=Z] run tp @s ~ ~ ~ -135 0

This is great, but it constantly will make them look in that direction as long as they're on that block. How would I make it so that they only look there when they first join, and then are free to look around? (ie. create a system where they spawn looking in a different direction than natural)

Related Questions

Updated November 26, 2017 06:14 AM

Updated March 16, 2019 12:14 PM

Updated December 27, 2017 04:14 AM

Updated April 21, 2017 05:14 AM

Updated June 30, 2017 19:14 PM