-2

In Minecraft, I'm creating a tube that is meant to take you up and down floors. The way I want to accomplish this is such that if you're facing down in the tube, you go down, and if you're facing up, you go up. My only issue is how to execute if an entity is facing a certain direction. I found execute if rotation and execute if facing, both seeming promising. If there's a way to make it react if the player if facing directly up, mindless of other rotations, that's good. If there's a way to make it work when facing an armor stand, that's good. I just want some way to detect whether a player is facing up or down. I have tried this:

/execute if entity player1 facing entity player2 feet run say command magic

This always would say command magic, whether or not player1 was facing player2's feet. I tried the same with eyes instead of feet, and it didn't work. Is there a way to do this?

  • Have you read the wiki page? It explains what facing and rotated really means. – Fabian Röling Jan 23 at 23:04
  • I did check, the way it was worded was confusing to me. – Meowl Jan 24 at 21:54
1

You need to use the x_rotation selector argument, see here: https://minecraft.gamepedia.com/Commands#Target_selector_arguments (archive)

You can filter players looking straight up with x_rotation=-90 and down with x_rotation=90.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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