Package net.minecraftforge.client.event
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.minecraftforge.client.event.InputEvent
InputEvent.ClickInputEvent, InputEvent.KeyInputEvent, InputEvent.MouseInputEvent, InputEvent.MouseScrollEvent, InputEvent.RawMouseEvent
-
-
Field Summary
Fields Modifier and Type Field Description private intbuttonprivate Handhandprivate booleanhandSwingprivate KeyBindingkeyBinding
-
Constructor Summary
Constructors Constructor Description ClickInputEvent(int button, KeyBinding keyBinding, Hand hand)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HandgetHand()The hand which is causing the event to get triggered.KeyBindinggetKeyBinding()booleanisAttack()booleanisPickBlock()booleanisUseItem()voidsetSwingHand(boolean value)Set to false to disable the hand swing animation.booleanshouldSwingHand()
-
-
-
Field Detail
-
button
private final int button
-
keyBinding
private final KeyBinding keyBinding
-
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()
-
-