The new net.minecraft.network.LpVec3 class fails to properly communicate Vec3 values when one of the vector’s axes is NaN. This can happen without external editing with minecarts, as seen in this video. When at least one axis is NaN, a 0 will be written for the first byte. This will cause the client to only read a single byte and return Vec3.ZERO. When this occurs, the extra bytes that were written from the server will not be read by the client and this will throw an exception. Attached is one such log from when this occurred and a world that contains a minecart with NaN motion. Attempting to join the world will kick the player.
My recommendation is to just write a double for each axis and not bother with this rather pointless network optimization.
can replicate 25w32a