Posted May 14, 20169 yr Note: I am very new to forge modding. public class KeyInputHandler { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; if(ExampleMod.keyBindings.isPressed()) System.out.println("ping"); System.out.println(player.posX); } } I have a keyInputHandler, so it fires every time a key is pressed. The problem I'm having is that what It's outputting. With this code, I get the message in my terminal (im using intellij). [12:56:48] [Client thread/INFO]: [com.example.examplemod.KeyInputHandler:onKeyInput:18]: ping 1183.323231183142 1183.323231183142 And any other keybind I press (moving around, spacebar, etc, it's spitting out the changing x pos on my player. Any help? (I'm not good at explaining my code haha..)
May 14, 20169 yr Author Oh, I completely forgot the brackets! thankyou! I'll change to the ClientTickEvent.
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.