Skip to content

KeyInputEvent


This event fires each time you press a key.

Note

This only applies to keybinds that are set in Minecraft settings.

Parameter

KeyInputEvent

Methods

Key

getKey()

Gets the pressed KeyBinding.

Example

@EventTarget
public void onKeyInput(KeyInputEvent event) {
    if (event.getKey() == mc.gameSettings.keyBindAttack) {
        Meowtils.addMessage("You pressed attack key!");
    }
}