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 ?