0

I would like to know what commands to put in when, for example, I want to teleport myself into y=11 but only when I'm facing north. and when I'm facing south I'll get teleported to y=-11

EDIT: Also, I've seen some threads here that ask almost the same questions here but I got the idea, but what I saw was only if a person was looking at a specific facing coordinate (where they'll use [x_rotation] and [y_rotation].

If you found some threads that ask exactly the same question. It would be highly appreciative if you link me into it :)

1 Answer 1

4

Nevermind I got it.

Anyhow, The command was simple but hard to implement.

/execute at @e[type=player,x_rotation=-45..45,y_rotation=135..-135] if block ~ ~-3 ~ minecraft:daylight_detector run tp @p ~ ~5 ~

adding the two ".." in between the numbers in the x_rotation and y_rotation allows the player to teleport when the player is looking at a direction BETWEEN -45 to 45 and 135 to -135

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.