Jump to content

salutpoilu

Members
  • Posts

    5
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

salutpoilu's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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 ?
×
×
  • Create New...

Important Information

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