Package org.bukkit.event.player
Class PlayerStatisticIncrementEvent
- java.lang.Object
-
- org.bukkit.event.Event
-
- org.bukkit.event.player.PlayerEvent
-
- org.bukkit.event.player.PlayerStatisticIncrementEvent
-
- All Implemented Interfaces:
Cancellable
public class PlayerStatisticIncrementEvent extends PlayerEvent implements Cancellable
Called when a player statistic is incremented.This event is not called for some high frequency statistics, e.g. movement based statistics.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
-
Field Summary
Fields Modifier and Type Field Description protected Statisticstatistic-
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
-
-
Constructor Summary
Constructors Constructor 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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable EntityTypegetEntityType()Gets the EntityType ifgetStatistic()is an entity statistic otherwise returns null.static @NotNull HandlerListgetHandlerList()@NotNull HandlerListgetHandlers()@Nullable MaterialgetMaterial()Gets the Material ifgetStatistic()is a block or item statistic otherwise returns null.intgetNewValue()Gets the new value of the statistic.intgetPreviousValue()Gets the previous value of the statistic.@NotNull StatisticgetStatistic()Gets the statistic that is being incremented.booleanisCancelled()Gets the cancellation state of this event.voidsetCancelled(boolean cancel)Sets the cancellation state of this event.-
Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
-
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
-
-
-
Field Detail
-
statistic
protected final Statistic statistic
-
-
Constructor Detail
-
PlayerStatisticIncrementEvent
public PlayerStatisticIncrementEvent(@NotNull @NotNull Player player, @NotNull @NotNull Statistic statistic, int initialValue, int newValue)
-
PlayerStatisticIncrementEvent
public PlayerStatisticIncrementEvent(@NotNull @NotNull Player player, @NotNull @NotNull Statistic statistic, int initialValue, int newValue, @NotNull @NotNull EntityType entityType)
-
-
Method Detail
-
getStatistic
@NotNull public @NotNull Statistic getStatistic()
Gets the statistic that is being incremented.- Returns:
- the incremented statistic
-
getPreviousValue
public int getPreviousValue()
Gets the previous value of the statistic.- Returns:
- the previous value of the statistic
-
getNewValue
public int getNewValue()
Gets the new value of the statistic.- Returns:
- the new value of the statistic
-
getEntityType
@Nullable public @Nullable EntityType getEntityType()
Gets the EntityType ifgetStatistic()is an entity statistic otherwise returns null.- Returns:
- the EntityType of the statistic
-
getMaterial
@Nullable public @Nullable Material getMaterial()
Gets the Material ifgetStatistic()is a block or item statistic otherwise returns null.- Returns:
- the Material of the statistic
-
isCancelled
public boolean isCancelled()
Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel)
Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel- true if you wish to cancel this event
-
getHandlers
@NotNull public @NotNull HandlerList getHandlers()
- Specified by:
getHandlersin classEvent
-
getHandlerList
@NotNull public static @NotNull HandlerList getHandlerList()
-
-