public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancellable
这个事件不会因 Statistic.PLAY_ONE_TICK 或基于移动(比如玩家走动、坐矿车的距离等)的统计数据的改变而触发.
Event.Result| 限定符和类型 | 字段和说明 |
|---|---|
protected Statistic |
statistic |
player| 构造器和说明 |
|---|
PlayerStatisticIncrementEvent(Player player,
Statistic statistic,
int initialValue,
int newValue) |
PlayerStatisticIncrementEvent(Player player,
Statistic statistic,
int initialValue,
int newValue,
EntityType entityType) |
PlayerStatisticIncrementEvent(Player player,
Statistic statistic,
int initialValue,
int newValue,
Material material) |
| 限定符和类型 | 方法和说明 |
|---|---|
EntityType |
getEntityType()
如果
getStatistic()是关于实体的统计信息,获取该统计数据的实体种类,否则返回null. |
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
Material |
getMaterial()
如果
getStatistic()是关于方块或物品的统计信息,获取该统计数据的物品种类,否则返回null. |
int |
getNewValue()
获取这个统计数据的新数据值.
|
int |
getPreviousValue()
获取这个统计信息之前的数据值.
|
Statistic |
getStatistic()
获取正在增长的统计数据.
|
boolean |
isCancelled()
获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
|
void |
setCancelled(boolean cancel)
取消这个事件.
|
getPlayergetEventName, isAsynchronousprotected final Statistic statistic
public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue)
public PlayerStatisticIncrementEvent(Player player, Statistic statistic, int initialValue, int newValue, EntityType entityType)
public Statistic getStatistic()
原文:Gets the statistic that is being incremented.
public int getPreviousValue()
原文:Gets the previous value of the statistic.
public int getNewValue()
原文:Gets the new value of the statistic.
public EntityType getEntityType()
getStatistic()是关于实体的统计信息,获取该统计数据的实体种类,否则返回null.
原文:Gets the EntityType if getStatistic() is an
entity statistic otherwise returns null.
public Material getMaterial()
getStatistic()是关于方块或物品的统计信息,获取该统计数据的物品种类,否则返回null.
原文:Gets the Material if getStatistic() is a block
or item statistic otherwise returns null.
public boolean isCancelled()
Cancellable原文:Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins
isCancelled 在接口中 Cancellablepublic void setCancelled(boolean cancel)
Cancellable原文:Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.
setCancelled 在接口中 Cancellablecancel - 如果你想取消这个事件,则为truepublic HandlerList getHandlers()
getHandlers 在类中 Eventpublic static HandlerList getHandlerList()