Class InputEvent.ClickInputEvent

  • Enclosing class:
    InputEvent

    public static class InputEvent.ClickInputEvent
    extends InputEvent
    This event fires when one of the keybindings that by default involves clicking the mouse buttons is triggered. These key bindings are use item, pick block and attack keybindings. (right, middle and left mouse click) In the case that these key bindings are re-bound to a keyboard key the event will still be fired as normal.
    • Field Detail

      • button

        private final int button
      • hand

        private final Hand hand
      • handSwing

        private boolean handSwing
    • Constructor Detail

      • ClickInputEvent

        public ClickInputEvent​(int button,
                               KeyBinding keyBinding,
                               Hand hand)
    • Method Detail

      • setSwingHand

        public void setSwingHand​(boolean value)
        Set to false to disable the hand swing animation. Has no effect if this is a pick block input.
      • shouldSwingHand

        public boolean shouldSwingHand()
      • getHand

        public Hand getHand()
        The hand which is causing the event to get triggered. The event will be called for both hands if this is a use item input regardless of if either gets canceled. Will always be MAIN_HAND if this is an attack or pick block input.
      • isAttack

        public boolean isAttack()
      • isUseItem

        public boolean isUseItem()
      • isPickBlock

        public boolean isPickBlock()
      • getKeyBinding

        public KeyBinding getKeyBinding()