Package net.minecraftforge.event.level
Class BlockEvent.BreakEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.BlockEvent
net.minecraftforge.event.level.BlockEvent.BreakEvent
- Enclosing class:
- 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 SummaryNested classes/interfaces inherited from class net.minecraftforge.event.level.BlockEventBlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEventNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintGet the experience dropped by the block after the event has processedvoidsetExpToDrop(int exp) Set the amount of experience dropped by the block after the event has processedMethods inherited from class net.minecraftforge.event.level.BlockEventgetLevel, getPos, getStateMethods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
- 
Field Details- 
playerReference to the Player who broke the block. If no player is available, use a EntityFakePlayer
- 
expprivate int exp
 
- 
- 
Constructor Details- 
BreakEvent
 
- 
- 
Method Details- 
getPlayer
- 
getExpToDroppublic 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
 
- 
setExpToDroppublic 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
 
 
-