Gamemode doesn't update in real time
benblank opened this issue ยท 1 comments
The gamemode
variable only updates when the world is loaded (opening a world, connecting to a server, or changing dimensions).
I dug into this a bit myself, and it seems this is due to getting the gamemode of the world rather than the player. Unfortunately, the only way I could find to get the player's gamemode involved crossing the client/server barrier, so only works in SSP:
this.minecraftServer.getConfigurationManager().getPlayerForUsername(this.minecraftClient.thePlayer.username).theItemInWorldManager.getGameType()