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!