Enum minecraft_json::minecraft::data::predicate::Predicate [−][src]
#[non_exhaustive] pub enum Predicate {}Show variants
Alternative { terms: Vec<Predicate>, }, BlockStateProperty { block: String, properties: BTreeMap<String, String>, }, DamageSourceProperties { predicate: DamageSource, }, EntityProperties { entity: WhichEntity, predicate: Box<Entity>, }, EntityScores { entity: WhichEntity, scores: BTreeMap<String, Ranged<isize>>, }, Inverted { term: Box<Predicate>, }, KilledByPlayer { inverse: bool, }, LocationCheck { offset_x: Option<isize>, offset_y: Option<isize>, offset_z: Option<isize>, predicate: Box<Location>, }, MatchTool { predicate: Box<Item>, }, RandomChance { chance: Number, }, RandomChanceWithLooting { chance: Number, looting_multiplier: Number, }, Reference { name: String, }, SurvivesExplosion, TableBonus { enchantment: isize, chances: Vec<Number>, }, TimeCheck { value: Ranged2<isize, NumberProviderValue<isize>>, period: Option<isize>, }, WeatherCheck { raining: Option<bool>, thundering: Option<bool>, }, ValueCheck { value: NumberProviderValue<isize>, range: Ranged<NumberProviderValue<isize>>, },
Expand description
Predicate.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Joins conditions from parameter terms with “or”.
Check properties of a block state.
Show fields
Check properties of damage source.
Show fields
Fields of DamageSourceProperties
predicate: DamageSource
Predicate applied to the damage source.
Test properties of an entity.
Show fields
Fields of EntityProperties
entity: WhichEntity
Specifies the entity to check for the condition.
predicate: Box<Entity>
Predicate applied to entity, uses same structure as advancements.
Test the scoreboard scores of an entity.
Show fields
Fields of EntityScores
entity: WhichEntity
Specifies the entity to check for the condition.
scores: BTreeMap<String, Ranged<isize>>
Scores to check. All specified scores must pass for the condition to pass.
Item: Key name is the objective while the value is the exact score value (or a range of score values) required for the condition to pass.
Inverts condition from parameter term.
Test if a WhichEntity::KillerPlayer
entity is available.
Show fields
Fields of KilledByPlayer
inverse: bool
If true, the condition passes if WhichEntity::KillerPlayer
is not available.
Checks if the current location matches.
Show fields
Checks tool.
Show fields
Test if a random number 0.0–1.0 is less than a specified value.
Show fields
Fields of RandomChance
chance: Number
Success rate as a number 0.0–1.0.
Test if a random number 0.0–1.0 is less than a specified value, affected by the level of
Looting
on the killer entity.
Show fields
Test if another referred condition (predicate) passes.
Show fields
Fields of Reference
name: String
The namespaced ID of the condition (predicate) referred to. A cyclic reference causes a parsing failure.
Returns true with 1/explosion radius probability.
Passes with probability picked from table, indexed by enchantment level.
Show fields
Checks the current time.
Show fields
Checks for a current weather state.
Show fields
Checks for range of value.
Show fields
Fields of ValueCheck
value: NumberProviderValue<isize>
Number Provider. The value to test.
range: Ranged<NumberProviderValue<isize>>
The exact value to check, or the range to check the value.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more