I have been trying to find out if you can store the direction a player is facing and maybe use it to summon an arrow that shoots in that direction. I want to make a gun but it would take years and very many command blocks to make a system that will detect every single direction and then shoot the arrow in that direction. That's why I'm asking if there is any way to do it.
1 Answer
Assuming 1.13.
To store player's rotation, use execute store
:
execute store result score rot0 store run data get entity @p Rotation[0] 1000000
execute store result score rot1 store run data get entity @p Rotation[1] 1000000
which stores his rotation in multidegree