I'm still trying to check where that does happen, but it seens to be always related when the camera tilts due suffocating by something (lava, water, gravel, sand etc...)
Â
I also can confirm that still affects 1.18
Same as I said on MCPE-125201 , Mojang can fix that by checking the StartGamePacket for NaN values in Pithc/Roll. This at least fixes the user to login.
For bedrock server, I did a fix-up by hooking the StartGamePacket WriteBinary:Â https://github.com/racerxdl/bedhock/blob/main/src/hooks/fixes.cpp#L23-L29
Â
This does not avoid the issue of the NaN values to happen, but at least they are able to login afterwards. I also did a check on PlayerAuthInputPacket, so the server doesnt save NaN values there as well
https://github.com/racerxdl/bedhock/blob/main/src/hooks/playerState.cpp#L45-L54
btw @kiizde for my bedrock server I fixed by hooking the StartGamePacket and setting the Pitch/Yaw values to 0 if NaN. This avoids the game crashing with a memory leak.
https://github.com/racerxdl/bedhock/blob/main/src/hooks/fixes.cpp#L23-L29
This should be doable in client side. Its more easy to simulate using MCPE-Linux (I know that's not official, but its easier to simulate there), but it does happen ocasionally at Minecraft for Windows 10 as well.
Â
The thing is that in local game and bedrock server, you can fix it by editing the NBT and setting the NaNs to zero in player profile, but when playing in a realm, you're stuck.Â
Â
Since the cause of NaN's are unknown, I would add to bedrock codebase a fix on StartGamePacket to ensure no NaN values go to client. This way, if the crash happens, you just need to log in the server again.
@Magdalena Wardak I couldnt reproduce the same issue on 1.18.2 with the same scenario. So looks good to me 😃Â