Posted July 10, 201213 yr I'm trying to make it so then when a player presses a specific key, something happens. @Override public void keyboardEvent(KeyBinding event) I inherited this function from BaseMod but it's never called... http://calclavia.com/uploads/banner.png[/img]
July 10, 201213 yr It looks like you forgot the KeyBinding Try this: public static KeyBinding Switch = new KeyBinding("Switch", 19); public void keyboardEvent(KeyBinding keybinding) { if(keybinding == Switch) { //Do stuff here } public void load() { ModLoader.registerKey(this, Switch, false); ModLoader.addLocalization("Switch", "Switch"); ModLoader.setInGameHook(this, true, true); }
July 10, 201213 yr Author Works. Thank you. Which keycode is for space bar? http://calclavia.com/uploads/banner.png[/img]
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.