Class PlayerBlockBreakEvent

java.lang.Object
net.minestom.server.event.player.PlayerBlockBreakEvent
All Implemented Interfaces:
Event, BlockEvent, CancellableEvent, EntityEvent, EntityInstanceEvent, InstanceEvent, PlayerEvent, PlayerInstanceEvent

public class PlayerBlockBreakEvent extends Object implements PlayerInstanceEvent, BlockEvent, CancellableEvent
  • Constructor Details

    • PlayerBlockBreakEvent

      public PlayerBlockBreakEvent(@NotNull @NotNull Player player, @NotNull @NotNull Block block, @NotNull @NotNull Block resultBlock, @NotNull @NotNull BlockVec blockPosition, @NotNull @NotNull BlockFace blockFace)
  • Method Details

    • getBlock

      @NotNull public @NotNull Block getBlock()
      Gets the block to break
      Specified by:
      getBlock in interface BlockEvent
      Returns:
      the block
    • getResultBlock

      @NotNull public @NotNull Block getResultBlock()
      Gets the block which will replace getBlock().
      Returns:
      the result block
    • getBlockFace

      @NotNull public @NotNull BlockFace getBlockFace()
      Gets the face at which the block was broken
      Returns:
      the block face
    • setResultBlock

      public void setResultBlock(@NotNull @NotNull Block resultBlock)
      Changes the result of the event.
      Parameters:
      resultBlock - the new block
    • getBlockPosition

      @NotNull public @NotNull BlockVec getBlockPosition()
      Gets the block position.
      Specified by:
      getBlockPosition in interface BlockEvent
      Returns:
      the block position
    • isCancelled

      public boolean isCancelled()
      Description copied from interface: CancellableEvent
      Gets if the Event should be cancelled or not.
      Specified by:
      isCancelled in interface CancellableEvent
      Returns:
      true if the event should be cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: CancellableEvent
      Marks the Event as cancelled or not.
      Specified by:
      setCancelled in interface CancellableEvent
      Parameters:
      cancel - true if the event should be cancelled, false otherwise
    • getPlayer

      @NotNull public @NotNull Player getPlayer()
      Description copied from interface: PlayerEvent
      Gets the player.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player