pub struct EnvTrigger {
pub id: TriggerId,
pub at: Option<AnchorId>,
pub prop: Option<Prop>,
pub on: TriggerOn,
pub requires_flags: Vec<FlagId>,
pub forbids_flags: Vec<FlagId>,
pub requires_state: Vec<StateCompare>,
pub once: bool,
pub audience: TriggerAudience,
pub effects: Vec<QuestEffect>,
}Expand description
A stage-5 environment trigger (DSL v0.4). Emission uses vanilla-intended
primitives only (spec-0008 §7): strike/use read a minecraft:interaction
entity’s attack/interaction records; approach is a distance selector on
the tick. Look-at / break-attempt detection is excluded on principle (no
vanilla primitive).
Fields§
§id: TriggerIdUnique trigger id (trigger/<kebab>).
at: Option<AnchorId>The anchor this trigger watches. Required for strike / use /
approach, which watch a place; absent for strike-npc (DSL
v0.6), which watches a character and names it in on.npc instead —
there is no cell for the author to supply and no cell the compiler
would use. Either mismatch is DW0194.
prop: Option<Prop>The visible object the click acts on (spec-0093 §6.5): for a use
or a strike trigger, the block the compiler places at at — a lever,
a bell, a lamp, a stone. A use on a block vanilla reports the use of
(a lever, a button, a bell) fires through vanilla’s default_block_use
criterion and summons no hitbox; any other prop, and every strike, is
placed with the minecraft:interaction hitbox fitted over it as its hit
area. A click trigger with no prop on open air is refused (DW0963):
the hitbox is invisible and is never the object. A prop on an event
with no cell of its own — an approach, a strike-npc, a
strike-assembly — is DW0964.
on: TriggerOnThe event that fires it.
requires_flags: Vec<FlagId>Flags that must be set before the trigger can fire (DSL v0.4).
forbids_flags: Vec<FlagId>Negative flag gate (DSL v0.6): the trigger is
suppressed while ANY listed flag is set (by any player — flags are
campaign state). The dual of requires_flags, so an “armed between two
story beats” trigger needs no re-arm plumbing: e.g. a strike-the-giant
retaliation trigger with requires_flags: [flag/sealed] and
forbids_flags: [flag/asleep] arms when the cave seals and stands down
the moment the wake beat takes over.
requires_state: Vec<StateCompare>Numeric gate terms (DSL v0.10, spec-0031): every listed comparison must hold for this gate to be open. The third field of the one gate, carried by every gate consumer — never by the verb that first wanted it. Default empty, so a pre-0.10 campaign is byte-identical.
once: boolFire at most once (default true, mirroring objective completion). Set
false to allow re-firing every time the condition is met.
audience: TriggerAudienceWho the trigger’s effects address (DSL v0.11). Default
TriggerAudience::Party, so every campaign written before this field
existed is byte-identical.
A trigger is two different things depending on what the author means by it. A pressure plate that opens a gate and narrates the room is a party beat: everyone should see it, and it does not matter who stepped on the plate. A barred door that answers “this cannot be opened from this side” is a reply to one person: broadcasting it tells four players about a door three of them are nowhere near.
Until this field the second was inexpressible, which is why the two verbs
that needed it (close-gate’s seal answer, and nothing at all for a
shortcut door) grew their own private reply machinery instead. The
capability belongs to the press, not to the verb.
effects: Vec<QuestEffect>Effects fired when the trigger matches.
Implementations§
Source§impl EnvTrigger
impl EnvTrigger
Source§impl EnvTrigger
impl EnvTrigger
Sourcepub fn at_anchor(&self) -> Option<&str>
pub fn at_anchor(&self) -> Option<&str>
The anchor this trigger watches, if it watches a place at all. None
for strike-npc, whose target is a character.
Sourcepub fn addresses_presser(&self) -> bool
pub fn addresses_presser(&self) -> bool
Whether this trigger’s bundle is addressed to the player who pressed it.
Sourcepub fn attributes_its_actor(&self) -> bool
pub fn attributes_its_actor(&self) -> bool
Whether vanilla can name the player whose act fired this trigger, which
is what audience: presser needs: a right-click (use, through
minecraft:player_interacted_with_entity) and a step (step, a player
in the cell). A left-click is recorded as a UUID no command can become;
everything else is refused by DW0427.
Trait Implementations§
Source§impl Clone for EnvTrigger
impl Clone for EnvTrigger
Source§impl Debug for EnvTrigger
impl Debug for EnvTrigger
Source§impl<'de> Deserialize<'de> for EnvTrigger
impl<'de> Deserialize<'de> for EnvTrigger
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for EnvTrigger
impl JsonSchema for EnvTrigger
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more