Class PlayerFinishDiggingEvent

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

public class PlayerFinishDiggingEvent extends Object implements PlayerInstanceEvent, BlockEvent
Called when a Player successfully finishes digging a block
  • Constructor Details

    • PlayerFinishDiggingEvent

      public PlayerFinishDiggingEvent(@NotNull @NotNull Player player, @NotNull @NotNull Block block, @NotNull @NotNull BlockVec blockPosition)
  • Method Details

    • setBlock

      public void setBlock(@NotNull @NotNull Block block)
      Changes which block was dug

      This has somewhat odd behavior; If you set it from a previously solid block to a non-solid block then cancel the respective PlayerBlockBreakEvent it will allow the player to phase through the block and into the floor (only if the player is standing on top of the block)

      Parameters:
      block - the block to set the result to
    • getBlock

      @NotNull public @NotNull Block getBlock()
      Gets the block which was dug.
      Specified by:
      getBlock in interface BlockEvent
      Returns:
      the block
    • getBlockPosition

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

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