mojira.dev
MC-303382

Player spawn points with rotation values outside of bounds aren't serialized

Relates to MC-303381

Steps to reproduce

  1. Open a world

  2. Use /spawnpoint @s 10000 100 10000 181 91

  3. /kill, you’ll respawn at 10000 100 10000 with a yaw of -179 and a pitch of 90

  4. Close and reopen the world

  5. /kill, you’ll respawn at the worldspawn

Expected result

The yaw and pitch get clamped into their respective bounds. Alternatively, the command fails with a message along the lines of “The provided yaw must be between -180 and 180!”.

Actual result

The spawnpoint isn’t serialized when the game saves. When the game saves, the following warning appears in the console:

[01:16:15] [Server thread/INFO]: Saving and pausing game...
[01:16:15] [Server thread/WARN]: [iki] Serialization errors:
axm['TheCrafter222'/28, l='ServerLevel[New World]', x=-6.60, y=-60.00, z=8.60]: Failed to encode value 'a[respawnData=a[globalPos=ResourceKey[minecraft:dimension / minecraft:overworld] iz{x=10000, y=100, z=10000}, yaw=181.0, pitch=91.0], forced=true]' to field 'respawn': Value 91.0 outside of range [-90.0:90.0]; Value 181.0 outside of range [-180.0:180.0]
[01:16:15] [Server thread/WARN]: [flf] Serialization errors:
axm['TheCrafter222'/28, l='ServerLevel[New World]', x=-6.60, y=-60.00, z=8.60]: Failed to encode value 'a[respawnData=a[globalPos=ResourceKey[minecraft:dimension / minecraft:overworld] iz{x=10000, y=100, z=10000}, yaw=181.0, pitch=91.0], forced=true]' to field 'respawn': Value 91.0 outside of range [-90.0:90.0]; Value 181.0 outside of range [-180.0:180.0]
[01:16:15] [Server thread/INFO]: Saving chunks for level 'ServerLevel[New World]'/minecraft:overworld

Linked issues

Comments 0

No comments.

T Niklas

bl4ckscor3

Confirmed

(Unassigned)

1.21.10, 25w42a

Retrieved