Contents
Class UseBlockEvent.Pre
java.lang.Object
com.hypixel.hytale.component.system.EcsEvent
com.hypixel.hytale.server.core.event.events.ecs.UseBlockEvent
com.hypixel.hytale.server.core.event.events.ecs.UseBlockEvent.Pre
- All Implemented Interfaces:
ICancellableEcsEvent
- Enclosing class:
UseBlockEvent
An event that is called before an entity interacts with a block in the world.
If cancelled, the interaction will return as failed.
-
Nested Class Summary
Nested classes/interfaces inherited from class UseBlockEvent
UseBlockEvent.Post, UseBlockEvent.Pre -
Constructor Summary
ConstructorsConstructorDescriptionPre(InteractionType interactionType, InteractionContext context, org.joml.Vector3i targetBlock, BlockType blockType) Default Constructor for aUseBlockEvent.Preinstance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether this event has been cancelled.voidsetCancelled(boolean cancelled) Changes whether this event has been cancelled or not.Methods inherited from class UseBlockEvent
getBlockType, getContext, getInteractionType, getTargetBlock
-
Constructor Details
-
Pre
public Pre(@Nonnull InteractionType interactionType, @Nonnull InteractionContext context, @Nonnull org.joml.Vector3i targetBlock, @Nonnull BlockType blockType) Default Constructor for aUseBlockEvent.Preinstance.- Parameters:
interactionType- The type of interaction being performed.context- The context of the interaction.targetBlock- The position of the block being interacted with.blockType- TheBlockTypeof the block being interacted with.
-
-
Method Details
-
isCancelled
public boolean isCancelled()Description copied from interface:ICancellableEcsEventReturns whether this event has been cancelled.- Specified by:
isCancelledin interfaceICancellableEcsEvent- Returns:
trueif the event is cancelled,falseotherwise.
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:ICancellableEcsEventChanges whether this event has been cancelled or not.- Specified by:
setCancelledin interfaceICancellableEcsEvent- Parameters:
cancelled- Whether the event should be cancelled.
-