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
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
Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final int
private final Hand
private boolean
private final KeyBinding
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetHand()
The hand which is causing the event to get triggered.boolean
isAttack()
boolean
boolean
void
setSwingHand
(boolean value) Set to false to disable the hand swing animation.boolean
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
button
private final int button -
keyBinding
-
hand
-
handSwing
private boolean handSwing
-
-
Constructor Details
-
ClickInputEvent
-
-
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
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
-