take

abstract fun take(player: Player, resourceId: Key, amount: Double): Boolean(source)

Takes amount of the resourceId, or nothing if the player has less. The plugin may take a different amount by its own rules, for example with a discount.

Return

true if the resource was taken, false if the player doesn't have enough, another plugin cancelled the change, it is unsupported, or the player's data isn't loaded.

Parameters

amount

Non-negative amount of the resource.

Throws

if amount is negative or not finite.