That was it I believe, so thanks!
I have those "keys" in my capability to carry a string, and then when I press my keybind it checks for what the corresponding key string is equal to. Then does that function, if that makes sense. My actual keybinds are made using this below;
private static final String CATEGORY = "key.categories." + Main.MODID;
public static KeyBinding HAND_INFUSION;
public static KeyBinding BODY_INFUSION;
public static KeyBinding LEG_INFUSION;
public static KeyBinding SHINOBI_STATS;
public static KeyBinding KEYBIND1;
public static KeyBinding KEYBIND2;
public static KeyBinding KEYBIND3;
public static KeyBinding KEYBIND4;
public static void register()
{
HAND_INFUSION = new KeyBinding("key." + Main.MODID + ".handinfusion", GLFW_KEY_R, CATEGORY);
BODY_INFUSION = new KeyBinding("key." + Main.MODID + ".bodyinfusion", GLFW_KEY_F, CATEGORY);
LEG_INFUSION = new KeyBinding("key." + Main.MODID + ".leginfusion", GLFW_KEY_C, CATEGORY);
SHINOBI_STATS = new KeyBinding("key." + Main.MODID + ".shinobistats", GLFW_KEY_P, CATEGORY);
KEYBIND1 = new KeyBinding("key." + Main.MODID + ".keybind1", GLFW_KEY_1, CATEGORY);
KEYBIND2 = new KeyBinding("key." + Main.MODID + ".keybind2", GLFW_KEY_2, CATEGORY);
KEYBIND3 = new KeyBinding("key." + Main.MODID + ".keybind3", GLFW_KEY_3, CATEGORY);
KEYBIND4 = new KeyBinding("key." + Main.MODID + ".keybind4", GLFW_KEY_4, CATEGORY);
ClientRegistry.registerKeyBinding(HAND_INFUSION);
ClientRegistry.registerKeyBinding(BODY_INFUSION);
ClientRegistry.registerKeyBinding(LEG_INFUSION);
ClientRegistry.registerKeyBinding(SHINOBI_STATS);
ClientRegistry.registerKeyBinding(KEYBIND1);
ClientRegistry.registerKeyBinding(KEYBIND2);
ClientRegistry.registerKeyBinding(KEYBIND3);
ClientRegistry.registerKeyBinding(KEYBIND4);
}
}
NetworkLoader.INSTANCE.send(PacketDistributor.PLAYER.with(() -> (ServerPlayerEntity) player), new PacketChakraSync(chakra));
That's how I do it, is that not correct?
Thanks for your responses though! I really appreciate it!