#Unable to get keybinds working on 1.21.1

3 messages · Page 1 of 1 (latest)

split galleon
#

Whenever i try to define keybinds on 1.21.1 (using the fabric API KeyBindingHelper) I always run into an error - java.lang.ClassNotFoundException: net.minecraft.client.option.KeyBinding (full error logs posted below)

Im defining keybinds the same way I do on 1.21.4 and it doesn't immediately seem like some compability issue but that could defo be the reason.

code segment that's causing the problem:

    public static KeyBinding DefineKeyboardKeybind(String translationKey, int key, String category) {
        Duve3utilsClient.LOGGER.info("Define Keybind: {}", translationKey);
        return KeyBindingHelper.registerKeyBinding(new KeyBinding(
                translationKey, // The translation key of the keybinding's name
                InputUtil.Type.KEYSYM, // The type of the keybinding, KEYSYM for keyboard, MOUSE for mouse.
                key, // The keycode of the key
                category // The translation key of the keybinding's category.
        ));
    }

full github repo (look in the client-side section): https://github.com/Duve3/Duve3Utils

Error logs when running on a new instance of fabric 1.21.1 with fabric API & my mod (Duve3utils) installed:
https://mclo.gs/Kvli7tF
-# ^ in the logs it might occasionally replace Duve3utilsClient with {MINECRAFT_USERNAME}utilsClient
I apologize if this is a really obvious error or something, im quite new to modding!

GitHub

small set of useful tools made in fabric. Contribute to Duve3/Duve3Utils development by creating an account on GitHub.

split galleon
#

forgot to say but when using the gradle "runClient" task it works perfectly fine, which leads me to believe its some kind of error with my environment but im not really sure what

#

its only when using an external launcher (like modrinith) that problems arise (even with nothing other than fabric API installed)