How to check the rotation of a player? I mean how to check if the player looks on X or Z? Is there any compass plugin that shows you a pop-up with your rotation?
Check PureEntitiesX. I honestly have no idea how to work with motions yet but in PureEntitiesX, they have MobAI which works with motions and rotations and stuff.
Use Player->getTargetBlock() PHP: /** @var Player $player */$targetVector = $player->getTargetBlock(99)->asVector3();
Yaw is measured in degrees. So you'll need to compare it to some numbers between 0 and 360. PHP: if ($player->getYaw() === 90) { $player->sendMessage("A right angle");} But I think there may be an easier way to solve your problem... Don't you want to just check if player's facing east/west/south/north? Because there is the getDirection method. PHP: if ($player->getDirection() === 2) { $player->sendMessage("North");}