Posted May 14, 201510 yr So far all the tutorials i've found are for 1.7.10, and i can get the keybind to show up in the controls area of settings. But when i press the associated key nothing happens, until i quit the game, then a flood of msgs show up. Also the drawString doesn't seem to happen at all. import net.minecraft.client.Minecraft; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; public class KeyInputHandler { @SubscribeEvent public void onKeyInput(InputEvent.KeyInputEvent event) { if(KeyBindings.openGUI.isPressed()){ mc.fontRendererObj.drawString("Z Pressed", 2, 20, 0xffffff); System.out.println("KEY Z"); //OPEN GUI } } protected static Minecraft mc = Minecraft.getMinecraft(); } I must be missing something. Also how do i enable/disable a class when the key is pressed?
May 14, 201510 yr Well, obviously. DrawString is drawing method, you can't just call it anywhere. If you want to have message in Chat then you do: Minecraft.getMinecraft().thePlayer.addChatMessage(message); for client. 1.7.10 is no longer supported by forge, you are on your own.
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.