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
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 inherited from class org.bukkit.event.player.PlayerEvent
player
-
Constructor Summary
ConstructorDescriptionPlayerStatisticIncrementEvent
(@NotNull Player player, @NotNull Statistic statistic, int initialValue, int newValue) PlayerStatisticIncrementEvent
(@NotNull Player player, @NotNull Statistic statistic, int initialValue, int newValue, @NotNull Material material) PlayerStatisticIncrementEvent
(@NotNull Player player, @NotNull Statistic statistic, int initialValue, int newValue, @NotNull EntityType entityType) -
Method Summary
Modifier and TypeMethodDescriptionGets the EntityType ifgetStatistic()
is an entity statistic otherwise returns null.static @NotNull HandlerList
Gets the Material ifgetStatistic()
is a block or item statistic otherwise returns null.int
Gets the new value of the statistic.int
Gets the previous value of the statistic.Gets the statistic that is being incremented.boolean
Gets the cancellation state of this event.void
setCancelled
(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
callEvent, getEventName, isAsynchronous
-
Field Details
-
statistic
-
-
Constructor Details
-
PlayerStatisticIncrementEvent
-
PlayerStatisticIncrementEvent
-
PlayerStatisticIncrementEvent
-
-
Method Details
-
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
Gets the EntityType ifgetStatistic()
is an entity statistic otherwise returns null.- Returns:
- the EntityType of the statistic
-
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: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- Specified by:
isCancelled
in interfaceCancellable
- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface: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.- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-