Huge thanks!
That solves my problem, but in my case i dont want command to keep spamming while button is pressed. If I use InputEvent.KeyInputEvent, I can use #getAction, but I found no way to do this on ClientTickEvent (I looked through KeyBinding source code but found no method that can help me). Docs says that isPressed should work only once, but it is not working that way.
@SubscribeEvent
public void onKeyPress(TickEvent.ClientTickEvent event) {
if(TEST.isPressed()){
Minecraft.getInstance().player.sendChatMessage("looool");
}
}
I initialise TEST as
public static final KeyBinding TEST = new KeyBinding("key.test", KeyConflictContext.IN_GAME, InputMappings.Type.KEYSYM, GLFW.GLFW_KEY_Z, "test");
I feel like I am doing something stupid and sorry if that really is so, but I tried as much, as I could and this still does not work. Maybe should I write custom KeyConflictContest?