public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancellable
This event is not called for some high frequency statistics, e.g. movement based statistics.
Event.Result
Modifier and Type | Field and Description |
---|---|
protected Statistic |
statistic |
player
Constructor and Description |
---|
PlayerStatisticIncrementEvent(@NotNull Player player,
@NotNull Statistic statistic,
int initialValue,
int newValue) |
PlayerStatisticIncrementEvent(@NotNull Player player,
@NotNull Statistic statistic,
int initialValue,
int newValue,
@NotNull EntityType entityType) |
PlayerStatisticIncrementEvent(@NotNull Player player,
@NotNull Statistic statistic,
int initialValue,
int newValue,
@NotNull Material material) |
Modifier and Type | Method and Description |
---|---|
@Nullable EntityType |
getEntityType()
Gets the EntityType if
getStatistic() is an
entity statistic otherwise returns null. |
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@Nullable Material |
getMaterial()
Gets the Material if
getStatistic() is a block
or item statistic otherwise returns null. |
int |
getNewValue()
Gets the new value of the statistic.
|
int |
getPreviousValue()
Gets the previous value of the statistic.
|
@NotNull Statistic |
getStatistic()
Gets the statistic that is being incremented.
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
getPlayer
callEvent, getEventName, isAsynchronous
protected final Statistic statistic
public PlayerStatisticIncrementEvent(@NotNull @NotNull Player player, @NotNull @NotNull Statistic statistic, int initialValue, int newValue)
public PlayerStatisticIncrementEvent(@NotNull @NotNull Player player, @NotNull @NotNull Statistic statistic, int initialValue, int newValue, @NotNull @NotNull EntityType entityType)
@NotNull public @NotNull Statistic getStatistic()
public int getPreviousValue()
public int getNewValue()
@Nullable public @Nullable EntityType getEntityType()
getStatistic()
is an
entity statistic otherwise returns null.@Nullable public @Nullable Material getMaterial()
getStatistic()
is a block
or item statistic otherwise returns null.public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.