The fix by @TriWonder81 resolves the bug, but it creates a new one: When pressing F3+F4+ESC and then releasing F3, the debug menu will open, which doesn't happen without the fix. This occurs because when pressing F3+F4, this.switchF3State is set to false, but when pressing ESC to exit the screen, this.switchF3State isn't changed, which means the F3 menu will open when F3 is released.
Both the initial and the new bug can be fixed by adding setSwitchF3State method to net.minecraft.client.Keyboard.java:
The fix by @TriWonder81 resolves the bug, but it creates a new one:
When pressing F3+F4+ESC and then releasing F3, the debug menu will open, which doesn't happen without the fix. This occurs because when pressing F3+F4,
this.switchF3Stateis set to false, but when pressing ESC to exit the screen,this.switchF3Stateisn't changed, which means the F3 menu will open when F3 is released.Both the initial and the new bug can be fixed by adding
setSwitchF3Statemethod tonet.minecraft.client.Keyboard.java:and changing
switchF3StateincheckForClosemethod ofnet.minecraft.client.gui.screen.GameModeSelectionScreen.java:so, when
GameModeSelectionScreencloses by releasing F3,switchF3Stateis set to false, otherwise, when ESC is pressed, it is true.