Enum minecraft_json::minecraft::common::NumberProvider[][src]

pub enum NumberProvider<I> {
    Constant {
        value: I,
    },
    Uniform {
        min: Box<NumberProviderValue<I>>,
        max: Box<NumberProviderValue<I>>,
    },
    Binomial {
        min: Box<NumberProviderValue<isize>>,
        max: Box<NumberProviderValue<Number>>,
    },
    Score {
        target: ScoreboardNameProvider,
        score: String,
        scale: Option<Number>,
    },
}
Expand description

Loot tables use number providers in some places that accept an int or float. They can either be defined as a constant value or as an object.

Variants

Constant

A constant value.

Show fields

Fields of Constant

value: I

The exact value.

Uniform

A random number following a uniform distribution between two values (inclusive).

Show fields

Fields of Uniform

min: Box<NumberProviderValue<I>>

Number provider. The minimum value.

max: Box<NumberProviderValue<I>>

Number provider. The maximum value.

Binomial

A random number following a binomial distribution.

Show fields

Fields of Binomial

min: Box<NumberProviderValue<isize>>

Number provider. The amount of trials.

max: Box<NumberProviderValue<Number>>

Number provider. The probability of success on an individual trial.

Score

A scoreboard value.

Show fields

Fields of Score

target: ScoreboardNameProvider

Scoreboard name provider.

score: String

The scoreboard objective.

scale: Option<Number>

Optional. Scale to multiply the score before returning it.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.