Class InteractEvent
java.lang.Object
dev.myriadclient.api.event.Cancellable
dev.myriadclient.api.event.events.InteractEvent
- Direct Known Subclasses:
InteractEvent.Block, InteractEvent.EntityTarget, InteractEvent.Item
The local player is about to right-click: a block, an item in the air, or an entity. Posted for clicks from the
mouse and from features alike. Cancel to stop the interaction: nothing is sent and vanilla treats it as failed.
Posted on the render thread, only while something listens.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRight-clicking a block face (placing, opening, using).static final classRight-clicking an entity (trading, mounting, naming).static final classUsing the held item without a block (eating, throwing, shooting). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInteractEvent(net.minecraft.world.InteractionHand hand) Core's; addons don't make these. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.InteractionHandhand()The hand used: main or off (vanilla tries the main hand first, then the off hand).Methods inherited from class Cancellable
cancel, isCancelled, setCancelled
-
Constructor Details
-
InteractEvent
protected InteractEvent(net.minecraft.world.InteractionHand hand) Core's; addons don't make these.
-
-
Method Details
-
hand
public net.minecraft.world.InteractionHand hand()The hand used: main or off (vanilla tries the main hand first, then the off hand).
-