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.

Featured Replies

Posted

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?

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.