Class 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.

    • Field Detail

      • statistic

        protected final Statistic statistic
    • 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
      • 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