As far as I remember PocketMine doesn't store the yaw and head yaw separately. An explicit packet with a different head yaw is probably needed.
On LBSG, you are teleported to a set location. Player::teleport() will work for you with the set pitch and yaw parameters
...except for a client-sided bug where pitch doesn't work properly... >_< https://github.com/pmmp/PocketMine-MP/issues/821
look at the parameters of the function https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/Player.php#L4002
You'll have to calculate how to set the yaw to make the player look at the wanted x coordinate. So you don't want to set it to x, but to a value which depends on x.
There was a helper function in Utils.php to help you evaluate the yaw and pitch from relative positions, but commented it out for some reason... (during the API 1.0.0 rewrite) So, looking at $pos2 from $pos1: PHP: $diff = $pos2->subtract($pos1)->normalize(); // now a unit vector$pitch = asin(-$diff->y);$yaw = acos($diff->z / cos($pitch)); Note that asin() and acos() return values in radians, so before you apss $pitch and $yaw to the player methods, you have to rad2deg() them first, or simply ($yaw / M_PI * 180).