Hey guys, I'm making a map and I'm trying to make an event where the player will look through a window and when the player looks past a certain point a mob spawns behind them. I'm fine with the summon part but checking for if a player is looking in a certain directional range is stumping me. I've tried looking online but haven't found the answer for 1.13 commands. Can anyone help me with this?
The Meaning of Life, the Universe, and Everything.
So this is a bit late but you can use the "y_rotation" selector argument. So have the following command:
/execute if entity @a[x=[x coord],y=[y coord],z=[z coord],dx=0,y_rotation=[rotation details]] run summon [summon details]
Obviously put in your specific x, y, z, rotation, and summon details. As a note I would suggest using a range for the rotation (because if it's set to the exact rotation it's unlikely the player will trigger). Tests that I've done suggest that a 10 degree range works pretty accurately but it depends on how lenient you want to make the summon. Hope this helps.
Thank you. I haven't checked this in a while and I was just thinking about this again. This sounds like exactly what I'm looking for. For clarity on the rotation, can you give me a random example of the syntax?