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.

salutpoilu

Members
  • Joined

  • Last visited

Everything posted by salutpoilu

  1. hook keyevent ? How can I do that ? I'm a bit lost sorry...
  2. It seems I need to override this (in net.minecraft.client.gui.GuiScreen) : /** * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). */ protected void keyTyped(char p_73869_1_, int p_73869_2_) { if (p_73869_2_ == 1) { this.mc.displayGuiScreen((GuiScreen)null); this.mc.setIngameFocus(); } } So, I created this class : import net.minecraft.client.gui.GuiScreen; public class GuiScreenOverride extends GuiScreen { @Override public void keyTyped(char c, int i){ System.out.println("debug"); } } But I don't know where I need to use it to make it works...
  3. I have been searching for hours when I found this : https://github.com/coolAlias/Tutorial-1.7.2/blob/master/src/main/java/tutorial/client/gui/GuiCustomPlayerInventory.java and this : http://www.minecraftforge.net/forum/index.php?topic=17647.0 , from the same guy. This guy seems to close his GUI without "KeyInputEvent". However, I don't really understand how it works... do you think it could be a solution ?
  4. Thank you for your answer. I'm trying to display an image above the head of players who are typing in the chat. Players must be able to read the chat history without displaying this image, that's why I need to check if the player is typing or not. I've seen this feature on a server, so I guess it's realizable.
  5. Hello there, I encounter some difficulties making my first mod. Goals : - detecting if a player is typing in the chat (not detecting if the chat is open, but when the player starts writing). - detecting if the first character the player wrote is a "!". I tried this : @SubscribeEvent public void onEvent(RenderTickEvent event) { if (Minecraft.getMinecraft().ingameGUI.getChatGUI().getChatOpen()) { if(keyBindTest.isPressed()) { System.out.println("debug"); } } } In this case, detecting if the chat is open works, but detecting the keypress doesn't. Another try : @SubscribeEvent public void onEvent(KeyInputEvent event) { if(keyBindTest.isPressed() && Minecraft.getMinecraft().ingameGUI.getChatGUI().getChatOpen()) { System.out.println("debug"); } } In this case, the keypress isn't detected either. Without "Minecraft.getMinecraft().ingameGUI.getChatGUI().getChatOpen()", detecting the keypress works, but only outside the chat. Do you have any idea ?

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.