Here is what I tried:-
private void doSmoothYawTurn(float yaw, float pitch, EntityPlayer player) {
if (player.rotationYaw <= 180F) {
for (int i = (int)player.rotationYaw; i != yaw ; i++) {
player.rotationYaw = i;
}
} else {
for (int i = (int)player.rotationYaw; i != yaw ; i--) {
player.rotationYaw = i;
}
}
player.rotationPitch = pitch;
}
But sadly, The game just freezes.