类 BlockEvent.BreakEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.level.BlockEvent
net.minecraftforge.event.level.BlockEvent.BreakEvent
- 封闭类:
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.
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.event.level.BlockEvent
BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明int
Get the experience dropped by the block after the event has processedvoid
setExpToDrop
(int exp) Set the amount of experience dropped by the block after the event has processed从类继承的方法 net.minecraftforge.event.level.BlockEvent
getLevel, getPos, getState
从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
player
Reference to the Player who broke the block. If no player is available, use a EntityFakePlayer -
exp
private int exp
-
-
构造器详细资料
-
BreakEvent
-
-
方法详细资料
-
getPlayer
-
getExpToDrop
public int getExpToDrop()Get the experience dropped by the block after the event has processed- 返回:
- 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- 参数:
exp
- 1 or higher to drop experience, else nothing will drop
-