of

Returns state with the given current amount and max. Negative values are replaced with zero, since some plugins let the amount go below it.

Throws

if amount or max is not finite.