net.minecraftforge.event.world

## Class BlockEvent.BreakEvent

- java.lang.Object
- - cpw.mods.fml.common.eventhandler.Event
  - - net.minecraftforge.event.world.BlockEvent
    - - net.minecraftforge.event.world.BlockEvent.BreakEvent

- Enclosing class:
    BlockEvent

      public static class BlockEvent.BreakEvent
      extends BlockEvent

  Event that is fired when an Block is about to be broken by a player Canceling this event will prevent the Block from being broken.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.minecraftforge.event.world.BlockEvent

      `BlockEvent.BreakEvent, BlockEvent.HarvestDropsEvent`

    - ### Nested classes/interfaces inherited from class cpw.mods.fml.common.eventhandler.Event

      `Event.HasResult, Event.Result`

  - ### Field Summary

    - ### Fields inherited from class net.minecraftforge.event.world.BlockEvent

      `block, blockMetadata, world, x, y, z`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BlockEvent.BreakEvent(int x, int y, int z, World world, Block block, int blockMetadata, EntityPlayer player)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getExpToDrop()` Get the experience dropped by the block after the event has processed
    `EntityPlayer` | `getPlayer()`
    `void` | `setExpToDrop(int exp)` Set the amount of experience dropped by the block after the event has processed

    - ### Methods inherited from class cpw.mods.fml.common.eventhandler.Event

      `getListenerList, getResult, hasResult, isCancelable, isCanceled, setCanceled, setResult, setup`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BlockEvent.BreakEvent

          public BlockEvent.BreakEvent(int x,
                               int y,
                               int z,
                               World world,
                               Block block,
                               int blockMetadata,
                               EntityPlayer player)

  - ### Method Detail

    - #### getPlayer

          public EntityPlayer getPlayer()

    - #### getExpToDrop

          public int getExpToDrop()

      Get the experience dropped by the block after the event has processed
      Returns:
        The experience to drop or 0 if the event was canceled

    - #### setExpToDrop

          public void setExpToDrop(int exp)

      Set the amount of experience dropped by the block after the event has processed
      Parameters:
        `exp` - 1 or higher to drop experience, else nothing will drop