Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

will0311

Members
  • Joined

  • Last visited

  1. Okay, i finally got it to work by adding "FMLCommonHandler.instance().bus().register(new KeyInputHandler());" . I'm confused, why should I use that as well as "MinecraftForge.EVENT_BUS.register(new KeyInputHandler());" ? If anyone would like to explain this to me briefly it would be much appreciated.
  2. will0311 joined the community
  3. Hello ! KeyInputEvent is not working for some reason... I've searched the internet and I can't figure out what is wrong, there isn't even an error, it just doesn't do anything. I put a System.out.println at the start as you can see, and even that doesn't appear in the console... Please help. And I'm sorry in advance if it is a stupid mistake that I have made, I've been on it for hours and I just can't figure it out. This is the KeyInputHandler package com.vizins.redscorpion; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; public class KeyInputHandler{ @SideOnly(Side.CLIENT) @SubscribeEvent public void onKeyInput(KeyInputEvent event) { System.out.println("key input detected"); if(RedScorpion.passivePowers.isPressed()) { System.out.println("V is pressed"); if(!Minecraft.getMinecraft().theWorld.isRemote) { System.out.println("world is remote"); if(Minecraft.getMinecraft().thePlayer.inventory.hasItem(RedScorpion.gadget)) { Minecraft.getMinecraft().displayGuiScreen(new PassivePowersGui()); } } } if(RedScorpion.changeGadget.isPressed()) { if(!Minecraft.getMinecraft().theWorld.isRemote) { if(Minecraft.getMinecraft().thePlayer.inventory.hasItem(RedScorpion.gadget)) { Minecraft.getMinecraft().displayGuiScreen(new ChangeGadgetGui()); } } } } } This is the main mod file. public class RedScorpion { //Key Binds public static KeyBinding changeGadget; public static KeyBinding passivePowers; @EventHandler public void preInit(FMLPreInitializationEvent event) { passivePowers = new KeyBinding("key.passivePowers", Keyboard.KEY_V, "key.categories.redscorpionsuit"); changeGadget = new KeyBinding("key.changeGadget", Keyboard.KEY_F, "key.categories.redscorpionsuit"); ClientRegistry.registerKeyBinding(passivePowers); ClientRegistry.registerKeyBinding(changeGadget); } @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new KeyInputHandler()); } } Thanks EDIT : This is for minecraft 1.7.10

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.