How can I do a command depending on where a player is facing?

How can I do a command depending on where a player is facing? - A Boy Playing Chess

I want to make things that go where a player is facing, for example a PrimedTnt move the direction a player is facing.



Best Answer

you can use

@p[rx=#,rxm=#]

to test someone's rotation




Pictures about "How can I do a command depending on where a player is facing?"

How can I do a command depending on where a player is facing? - Woman in Green Shirt Looking Down
How can I do a command depending on where a player is facing? - A Boy in Plaid Shirt Playing Chess
How can I do a command depending on where a player is facing? - A Player Fixing His Tennis Racket



How do you test a player for a specific direction?

2. Type the Command
  • Test if Players are within 10 blocks. In this example, we will test to see if there are any players within a 10 block radius with the following command: /testfor @a[r=10] ...
  • Test if Mooshrooms are within 50 blocks. ...
  • Test if Nearest Player is at Level 20 experience.


  • How do you test a player in Minecraft in a certain area?

    The center of interest of this post is another feature of Minecraft, and that is the use of commands in the game....How to select targets with Minecraft commands:TargetDescription@pTo target the nearest Player@rTo target a random Player@sTo target the person executing the command (yourself)2 more rows



    Minecraft Player Facing Command




    More answers regarding how can I do a command depending on where a player is facing?

    Answer 2

    You should do some research before answering

    this video will help

    (yeah i actually don't know ;-;)

    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Vlada Karpovich, cottonbro, Vlada Karpovich, cottonbro