Class UseBlockEvent

java.lang.Object
com.hypixel.hytale.component.system.EcsEvent
com.hypixel.hytale.server.core.event.events.ecs.UseBlockEvent
Direct Known Subclasses:
UseBlockEvent.Post, UseBlockEvent.Pre

public abstract class UseBlockEvent extends EcsEvent
An event that is called when an entity interacts with a block in the world.
  • Constructor Details

    • UseBlockEvent

      public UseBlockEvent(@Nonnull InteractionType interactionType, @Nonnull InteractionContext context, @Nonnull org.joml.Vector3i targetBlock, @Nonnull BlockType blockType)
      Default Constructor for a UseBlockEvent instance.
      Parameters:
      interactionType - The type of interaction being performed.
      context - The context of the interaction.
      targetBlock - The position of the block being interacted with.
      blockType - The BlockType of the block being interacted with.
  • Method Details

    • getInteractionType

      @Nonnull public InteractionType getInteractionType()
      Returns:
      the type of interaction being performed.
    • getContext

      @Nonnull public InteractionContext getContext()
      Returns:
      the context of the interaction.
    • getTargetBlock

      @Nonnull public org.joml.Vector3i getTargetBlock()
      Returns:
      the position of the block being broken.
    • getBlockType

      @Nonnull public BlockType getBlockType()
      Returns:
      the BlockType of the block being broken.