Class InputEvent.ClickInputEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.InputEvent
net.minecraftforge.client.event.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 Details

    • button

      private final int button
    • keyBinding

      private final KeyBinding keyBinding
    • hand

      private final Hand hand
    • handSwing

      private boolean handSwing
  • Constructor Details

    • ClickInputEvent

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

    • 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()