org.bukkit.event.player
Class PlayerStatisticIncrementEvent

java.lang.Object
  extended by org.bukkit.event.Event
      extended by org.bukkit.event.player.PlayerEvent
          extended by 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 Statistic.PLAY_ONE_TICK or movement based statistics.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
 
Field Summary
protected  Statistic statistic
           
 
Fields inherited from class org.bukkit.event.player.PlayerEvent
player
 
Constructor Summary
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)
           
 
Method Summary
 EntityType getEntityType()
          Gets the EntityType if getStatistic() is an entity statistic otherwise returns null.
static HandlerList getHandlerList()
           
 HandlerList getHandlers()
           
 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.
 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.
 
Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
 
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

statistic

protected final Statistic statistic
Constructor Detail

PlayerStatisticIncrementEvent

public PlayerStatisticIncrementEvent(Player player,
                                     Statistic statistic,
                                     int initialValue,
                                     int newValue)

PlayerStatisticIncrementEvent

public PlayerStatisticIncrementEvent(Player player,
                                     Statistic statistic,
                                     int initialValue,
                                     int newValue,
                                     EntityType entityType)

PlayerStatisticIncrementEvent

public PlayerStatisticIncrementEvent(Player player,
                                     Statistic statistic,
                                     int initialValue,
                                     int newValue,
                                     Material material)
Method Detail

getStatistic

public 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

public EntityType getEntityType()
Gets the EntityType if getStatistic() is an entity statistic otherwise returns null.

Returns:
the EntityType of the statistic

getMaterial

public Material getMaterial()
Gets the Material if getStatistic() 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 interface Cancellable
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 interface Cancellable
Parameters:
cancel - true if you wish to cancel this event

getHandlers

public HandlerList getHandlers()
Specified by:
getHandlers in class Event

getHandlerList

public static HandlerList getHandlerList()


Copyright © 2014. All rights reserved.