mojira.dev
MC-260836

Previously Selected Gamemode Not Being Saved

The player's previous gamemode is not saved correctly on the server.

Expected behaviour (behaviour in versions prior to 1.19.3):

  • /gamemode creative

  • /gamemode spectator

  • Press f3 + f4 (switches back to creative)

  • /kill or rejoin the world/server

  • Press f3 + f4 (switches back to spectator)

Observed behaviour (1.19.3+):

  • /gamemode creative

  • /gamemode spectator

  • Press f3 + f4 (switches back to creative)

  • /kill or rejoin the world/server

  • Press f3 + f4 (switches to survival)

Code analysis (yarn mappings):

ServerPlayerInteractionManager#changeGameMode (1.19.3):

[media]

ServerPlayerInteractionManager#changeGameMode (prior to 1.19.3):

[media]

The previous game mode being set in ServerPlayerInteractionManager#setGameMode is no longer being set to the existing gamemode but instead the previous meaning that this never changes - it is always null, unless the player had set their previous gamemode in a version prior to 1.19.3.

Linked issues

Attachments

Comments 2

Duplicate of MC-259571; your report does have clear steps to reproduce and analysis though.

I'd suggest mods copy that over.

senseiwells

(Unassigned)

Unconfirmed

(Unassigned)

1.19.3, 1.19.4 Pre-release 4

Retrieved