ResourceState

@ApiStatus.NonExtendable
interface ResourceState(source)

Snapshot of a player's resource: how much they have and how much they can have. The maximum is the one that applies to this player now, so it may differ between players.

Values are read together and change all the time because of regeneration, so don't cache them. States are equal if all their values are equal.

Create it with ResourceState.of:

ResourceState.of(15.0, 20.0);

Since

0.10.0

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val amount: Double

Current amount. It may be above max if the plugin allows it.

Link copied to clipboard
abstract val max: Double

The highest amount the player can have now.