Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

helix / PredicateSpec

Type Alias: PredicateSpec โ€‹

PredicateSpec = { args: object; id: keyof LootConditionArgs; kind: "vanilla"; } | { kind: "entity"; spec: EntityPredicateSpec; who: EntityTarget; } | { kind: "scores"; scores: Record<string, ScoreBound>; who: EntityTarget; } | { kind: "score_value"; name: string; objective: string; range: ScoreBound; } | { block: BlockValue; kind: "block_state"; properties?: Record<string, string>; } | { kind: "location"; offset?: [number, number, number]; spec: LocationSpec; } | { kind: "weather"; spec: { raining?: boolean; thundering?: boolean; }; } | { clock?: string | Id; kind: "time_check"; period?: number; value: Bound; } | { attribute: string | Id; kind: "environment_attribute"; value: unknown; } | { chance: number; kind: "random_chance"; } | { item: ItemValue; kind: "match_tool"; } | { inverse?: boolean; kind: "killed_by_player"; } | { kind: "survives_explosion"; } | { chances: number[]; enchantment: string | Enchantment; kind: "table_bonus"; } | { kind: "damage_source"; spec: DamageSourceSpec; } | { active: boolean; kind: "enchantment_active"; } | { chance: number; enchantment: string | Enchantment; kind: "random_chance_with_bonus"; perLevel: number; } | { kind: "reference"; ref: PredicateRef | Id | string; } | { kind: "all_of" | "any_of"; terms: Predicate[]; } | { kind: "inverted"; term: Predicate; }

Defined in: core/values/predicate/predicate.ts:23

One predicate condition; the IR turns it into condition JSON per version.

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.