Contents
Class BreakBlockEvent
java.lang.Object
com.hypixel.hytale.component.system.EcsEvent
com.hypixel.hytale.component.system.CancellableEcsEvent
com.hypixel.hytale.server.core.event.events.ecs.BreakBlockEvent
- All Implemented Interfaces:
ICancellableEcsEvent
An event that is called when a block is broken in the world.
If cancelled, the block will not be broken.
-
Constructor Summary
ConstructorsConstructorDescriptionBreakBlockEvent(ItemStack itemInHand, org.joml.Vector3i targetBlock, BlockType blockType) Default Constructor for aBreakBlockEventinstance. -
Method Summary
Modifier and TypeMethodDescriptionorg.joml.Vector3ivoidsetTargetBlock(org.joml.Vector3i targetBlock) Methods inherited from class CancellableEcsEvent
isCancelled, setCancelled
-
Constructor Details
-
BreakBlockEvent
public BreakBlockEvent(@Nullable ItemStack itemInHand, @Nonnull org.joml.Vector3i targetBlock, @Nonnull BlockType blockType) Default Constructor for aBreakBlockEventinstance.- Parameters:
itemInHand- The item in the instigating entity's hand, if any.targetBlock- The position of the block being broken.blockType- TheBlockTypeof the block being broken.
-
-
Method Details
-
getItemInHand
- Returns:
- the item in the instigating entity's hand, or
nullif none.
-
getTargetBlock
@Nonnull public org.joml.Vector3i getTargetBlock()- Returns:
- the position of the block being broken.
-
getBlockType
-
setTargetBlock
public void setTargetBlock(@Nonnull org.joml.Vector3i targetBlock) - Parameters:
targetBlock- The new target block position.
-