Posted August 29, 20232 yr This is my code : @Mod.EventBusSubscriber(value = Dist.CLIENT) public class KeyBoardInput { public static final KeyMapping BASE_SKILL = new KeyMapping("key.message", KeyConflictContext.IN_GAME, KeyModifier.CONTROL, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_J, "key.category.neutrino"); @SubscribeEvent public static void onKeyboardInput(InputEvent.Key event) { System.err.println(event.getKey()+":"+event.getAction()); if (BASE_SKILL.consumeClick()) { assert Minecraft.getInstance().player != null; System.out.println("Player"+Minecraft.getInstance().player.getName()+"down"+event.getKey()); }else{ System.out.println("not a rule"); } } } @Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT) public class KeybindingRegistry { @SubscribeEvent public static void onClientSetup(FMLClientSetupEvent event) { ClientRegistry.registerKeyBinding(KeyBoardInput.BASE_SKILL); } } This is my version 1.16 code, and it is successful, but there is no ClientRegistry class in 1.19.4, and I don’t know if there is any problem with other parts. And i did not find a corresponding countermeasure in https://forge.gemwire.uk/wiki/Main_Page
August 29, 20232 yr https://github.com/MinecraftForge/MinecraftForge/blob/1.20.x/src/main/java/net/minecraftforge/client/event/RegisterKeyMappingsEvent.java Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.