StatisticsTracker

A tracker of statistics.

Functions

Link copied to clipboard
open fun decrementStatistic(statistic: Key)

Decreases the value of the given custom statistic by 1.

open fun decrementStatistic(statistic: Statistic<*>)

Decreases the value of the given statistic by 1.

open fun decrementStatistic(statistic: Key, amount: Int)

Decreases the value of the given custom statistic by the given amount.

abstract fun decrementStatistic(statistic: Statistic<*>, amount: Int)

Decreases the value of the given statistic by the given amount.

Link copied to clipboard
abstract fun getStatistic(statistic: Key): Int

Gets the value for the given custom statistic.

abstract fun getStatistic(statistic: Statistic<*>): Int

Gets the value for the given statistic.

Link copied to clipboard
open fun incrementStatistic(statistic: Key)

Increases the value of the given custom statistic by 1.

open fun incrementStatistic(statistic: Statistic<*>)

Increases the value of the given statistic by 1.

open fun incrementStatistic(statistic: Key, amount: Int)

Increases the value of the given custom statistic by the given amount.

abstract fun incrementStatistic(statistic: Statistic<*>, amount: Int)

Increases the value of the given statistic by the given amount.

Link copied to clipboard
abstract fun invalidate()

Invalidates all currently tracked statistics, forcing the server to re-send all statistics when the player next requests them, even if none of them have actually been updated.

Link copied to clipboard
abstract fun setStatistic(statistic: Statistic<*>, value: Int)

Sets the value for the given statistic to the given value.

Link copied to clipboard
abstract fun statistics(): Set<Statistic<*>>

Gets all the statistics that are being tracked by this tracker.