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(Player player, Block block, BlockVec blockPosition)
  • Method Details

    • setBlock

      public void setBlock(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

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

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

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