Advertisement
ViiRuS

Keybinds (mod_ file Code)

Nov 27th, 2011
1,113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.82 KB | None | 0 0
  1. private KeyBinding key_fly = new KeyBinding("key.fly", 15);
  2.  
  3. ModLoader.SetInGameHook(this, true, false);
  4.  
  5. ModLoader.RegisterKey(this, this.key_fly, false);
  6. ModLoader.AddLocalization("key.fly", "Fly");
  7.  
  8. public boolean OnTickInGame(float f, Minecraft minecraft) {
  9.         PlayerCapabilities m = ModLoader.getMinecraftInstance().thePlayer.capabilities;
  10.         if(fly)
  11.         {
  12.             m.allowFlying = true;
  13.         }
  14.         else
  15.         {
  16.             m.allowFlying = false;
  17.         }
  18.         return true;
  19.                 }
  20.  
  21.  
  22. public void KeyboardEvent(KeyBinding event)
  23.     {
  24.             Minecraft minecraft = ModLoader.getMinecraftInstance();
  25.             if (event == this.key_fly)
  26.             {
  27.               fly = !fly;
  28.             }
  29.         }
  30.  
  31. public boolean fly;
  32.  
  33. Keyboard Values Link: http://img87.imageshack.us/img87/5476/keyboardt.png
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement