InGame Info XML

InGame Info XML

22M Downloads

Gamemode doesn't update in real time

benblank opened this issue ยท 1 comments

commented

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()
commented

That's a bug that I've almost forgot about. I'll most probably add this as the default return type and using the current gamemode as a fall back (for MP).