Pressing F3+F4 in a chest opens the game mode change menu, unlike in Minecraft Vanilla.
Minecraft Version: 1.21.10
NeoForge Version: 21.10.1-beta
Steps to Reproduce:
- Open a chest
- Press F3+F4
Description of issue:
Pressing F3+F4 in a chest opens the game mode change menu, unlike in Minecraft Vanilla.
Here is the current research into this:
This seems to stem from a thing mezz reported in https://bugs-legacy.mojang.com/browse/MC-146650 and subsequently made a merged pr for in https://github.com/MinecraftForge/MinecraftForge/pull/5367. However, the bug was marked as invalid due to mezz's misinterpretation of the return value. However, the behavior still remained, which led to an issue where the abstract container screen would no longer catch and consume all inputs, leading to unexpected behavior of events further down the chain. There seemed to be an attempt to revert the issue in https://github.com/MinecraftForge/MinecraftForge/pull/6160, but it never got merged due to changes in event behavior. Most prevalently, ScreenEvent.KeyPressed.Post will no longer fire for container screens, given that the key is not technically handled but consumed by the container screen.
What solution should be pursued depends on whether we want to consider 'consumed' keys as 'handled' for the purposes of the event. I will wait for more comments for the @neoforged/maintainers team.
Given the inconsistency of how debug keys are applied in screens, I've elected to create an issue with Mojang on this topic: https://bugs.mojang.com/browse/MC/issues/MC-302641.
Further decision will wait until their response.
https://github.com/user-attachments/assets/106c3649-301c-4767-bcd6-9b48157bc108