Skip to main content

Objective

Enum Objective 

Source
pub enum Objective {
    TalkTo {
        id: ObjectiveId,
        title: Option<String>,
        hint: Option<String>,
        npc: NpcId,
        after: Vec<ObjectiveId>,
        requires_flags: Vec<FlagId>,
        forbids_flags: Vec<FlagId>,
        requires_state: Vec<StateCompare>,
        stealth: bool,
        happening: Option<Happening>,
    },
    ReachAnchor {
        id: ObjectiveId,
        title: Option<String>,
        hint: Option<String>,
        anchor: AnchorId,
        radius: u32,
        after: Vec<ObjectiveId>,
        requires_flags: Vec<FlagId>,
        forbids_flags: Vec<FlagId>,
        requires_state: Vec<StateCompare>,
        stealth: bool,
        happening: Option<Happening>,
    },
    Kill {
        id: ObjectiveId,
        title: Option<String>,
        hint: Option<String>,
        wave: WaveId,
        after: Vec<ObjectiveId>,
        requires_flags: Vec<FlagId>,
        forbids_flags: Vec<FlagId>,
        requires_state: Vec<StateCompare>,
        stealth: bool,
        happening: Option<Happening>,
    },
    Collect {
Show 16 fields id: ObjectiveId, title: Option<String>, hint: Option<String>, item: String, count: u32, anchor: AnchorId, container: Option<AnchorId>, dropped_by: Option<WaveId>, item_name: Option<String>, fill_count: u32, after: Vec<ObjectiveId>, requires_flags: Vec<FlagId>, forbids_flags: Vec<FlagId>, requires_state: Vec<StateCompare>, stealth: bool, happening: Option<Happening>,
}, Interact {
Show 13 fields id: ObjectiveId, title: Option<String>, hint: Option<String>, anchor: AnchorId, requires_item: Option<String>, missing_item_hint: Option<String>, prop: Option<Prop>, after: Vec<ObjectiveId>, requires_flags: Vec<FlagId>, forbids_flags: Vec<FlagId>, requires_state: Vec<StateCompare>, stealth: bool, happening: Option<Happening>,
}, }
Expand description

A quest objective.

Every variant may carry requires_flags: flag-gated activation, satisfied only once each referenced flag has been set by a set-flag effect.

Variants§

§

TalkTo

Completed by a dialogue option’s complete-objective effect.

Fields

§id: ObjectiveId

Objective id.

§title: Option<String>

Short player-facing objective name (v0.3, optional).

§hint: Option<String>

One-line location/direction hint (v0.3, optional).

§npc: NpcId

The NPC to talk to.

§after: Vec<ObjectiveId>

Prerequisite objectives (intra-quest ordering).

§requires_flags: Vec<FlagId>

Flags that must be set before this objective activates (v0.3).

§forbids_flags: Vec<FlagId>

Negative flag gate (DSL v0.6): the objective is suppressed (cannot activate or complete) while ANY listed flag is set for the player — the dual of requires_flags.

§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.

§stealth: bool

Bot stealth hint (DSL v0.4): mark this leg as one the critical-path bot should traverse sneaking (sprint disabled). Emitted into critical-path.json as sneak: true on the step. Purely a harness hint; no datapack effect.

§happening: Option<Happening>

What this objective does to the story (DSL v0.8, spec-0025; required at 0.8.0, DW0481).

§

ReachAnchor

Completed by reaching an anchor once prerequisites are met.

Fields

§id: ObjectiveId

Objective id.

§title: Option<String>

Short player-facing objective name (v0.3, optional).

§hint: Option<String>

One-line location/direction hint (v0.3, optional).

§anchor: AnchorId

The anchor to reach.

§radius: u32

Completion radius (blocks).

§after: Vec<ObjectiveId>

Prerequisite objectives (intra-quest ordering).

§requires_flags: Vec<FlagId>

Flags that must be set before this objective activates (v0.3).

§forbids_flags: Vec<FlagId>

Negative flag gate (DSL v0.6): the objective is suppressed (cannot activate or complete) while ANY listed flag is set for the player — the dual of requires_flags.

§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.

§stealth: bool

Bot stealth hint (DSL v0.4): mark this leg as one the critical-path bot should traverse sneaking (sprint disabled). Emitted into critical-path.json as sneak: true on the step. Purely a harness hint; no datapack effect.

§happening: Option<Happening>

What this objective does to the story (DSL v0.8, spec-0025; required at 0.8.0, DW0481).

§

Kill

Completed when the referenced wave is fully slain (v0.3).

Fields

§id: ObjectiveId

Objective id.

§title: Option<String>

Short player-facing objective name (v0.3, optional).

§hint: Option<String>

One-line location/direction hint (v0.3, optional).

§wave: WaveId

The wave (stage-5 waves ref) whose mobs must be slain.

§after: Vec<ObjectiveId>

Prerequisite objectives.

§requires_flags: Vec<FlagId>

Flags that must be set before this objective activates (v0.3).

§forbids_flags: Vec<FlagId>

Negative flag gate (DSL v0.6): the objective is suppressed (cannot activate or complete) while ANY listed flag is set for the player — the dual of requires_flags.

§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.

§stealth: bool

Bot stealth hint (DSL v0.4): mark this leg as one the critical-path bot should traverse sneaking (sprint disabled). Emitted into critical-path.json as sneak: true on the step. Purely a harness hint; no datapack effect.

§happening: Option<Happening>

What this objective does to the story (DSL v0.8, spec-0025; required at 0.8.0, DW0481).

§

Collect

Completed when count of item have been collected (v0.3).

The items are provided in a container: the compiler’s own chest at anchor by default, or — since DSL v0.8 — the prefab’s existing chest/barrel at Objective::Collect::container, optionally carrying an Objective::Collect::item_name and padded to read full with Objective::Collect::fill_count.

Fields

§id: ObjectiveId

Objective id.

§title: Option<String>

Short player-facing objective name (v0.3, optional).

§hint: Option<String>

One-line location/direction hint (v0.3, optional).

§item: String

Vanilla item id to collect (validated against the registry).

§count: u32

How many are required.

§anchor: AnchorId

The anchor items are provided at (chest / pickup).

§container: Option<AnchorId>

Adopt the container the prefab already placed: the anchor whose assembled-world cell holds a chest / trapped_chest / barrel this collect fills instead of conjuring its own chest at Objective::Collect::anchor.

Same division of labour a loot entry and a trap’s dispenser already keep with the prefab: furniture belongs in the piece. A beach camp’s barrel is scenery the player has been walking past since minute one — having the compiler setblock a second, floating chest beside it to hold the quest item is exactly the downstream workaround the no-hack rule forbids. A container whose cell holds no container is a build error (DW0438), never a silent fill into a wall.

The critical-path step’s position follows the container (the bot opens this block), and no chest is placed at anchor when it is set.

§dropped_by: Option<WaveId>

The item comes off a body, not out of a box: the wave whose declared drops[] yield this objective’s item. No container is placed — not the compiler’s own chest at anchor, not a prefab one — and container is therefore mutually exclusive with it (DW0100-adjacent; DW0492).

This is what makes “kill the boss → pick up its key → open the door” a proved chain rather than an authoring intention. The compiler requires (a) that the named wave really declares an {item} drop of this item (DW0492), and (b) that a kill objective for that wave precedes this collect in the objective graph (DW0493). The existing flow machinery then carries the ordering the rest of the way: the door’s requires_flags hangs off this collect exactly as it would off a chest one.

Waves only. An actor’s death is not observable by any objective — there is no vanilla-side signal the flow machinery could consume — so an actor-gated collect would be an unprovable claim, and per the no-hack doctrine it is excluded rather than approximated. An actor may still declare drops[]; those drops just cannot gate a quest.

§item_name: Option<String>

Display name for the collected item (DSL v0.8), emitted as the vanilla custom_name item component.

A quest item is a named thing in the story (“Cheese”, “Tide Ledger”), and a player who opens the barrel must read that name — an unnamed minecraft:pumpkin_pie says nothing about what the quest asked for. Player-visible, so it enters the l10n string inventory (obj.<quest>.<obj>.item_name) and translates like any other line.

Naming changes nothing about adjudication: the completion advancement and the per-tick held check both match on the ITEM ID, which a named stack still carries.

§fill_count: u32

Padding stacks that make the container read full. Default 0 = the single required stack and nothing else.

A barrel of cheese that opens on one lonely wheel reads as a bug, and vanilla’s notion of “full” is occupied slots, not stack size — so this counts SLOTS: the objective’s own stack lands in container.0 and each padding stack repeats it in container.1, container.2, … Slot assignment is positional and total, the same determinism story loot tells (ADR-0006): no RNG, no loot tables, nothing to reseed.

The padding is the same item, so taking the whole barrel still completes the objective and never over- or under-counts it.

§after: Vec<ObjectiveId>

Prerequisite objectives.

§requires_flags: Vec<FlagId>

Flags that must be set before this objective activates (v0.3).

§forbids_flags: Vec<FlagId>

Negative flag gate (DSL v0.6): the objective is suppressed (cannot activate or complete) while ANY listed flag is set for the player — the dual of requires_flags.

§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.

§stealth: bool

Bot stealth hint (DSL v0.4): mark this leg as one the critical-path bot should traverse sneaking (sprint disabled). Emitted into critical-path.json as sneak: true on the step. Purely a harness hint; no datapack effect.

§happening: Option<Happening>

What this objective does to the story (DSL v0.8, spec-0025; required at 0.8.0, DW0481).

§

Interact

Completed by interacting with an entity at anchor; if requires_item is set, the item must be held in the main hand (v0.3; held semantics since DSL v0.7 — see Objective::Interact::requires_item).

Fields

§id: ObjectiveId

Objective id.

§title: Option<String>

Short player-facing objective name (v0.3, optional).

§hint: Option<String>

One-line location/direction hint (v0.3, optional).

§anchor: AnchorId

The anchor the interaction entity stands at.

§requires_item: Option<String>

Item the player must be holding in the main hand for the interaction to complete (optional).

Held, not merely possessed: presenting the item IS the action — a player who right-clicks a sleeping giant with a sharpened stake buried in their backpack has not stabbed anything. Before this ruling the gate read the whole inventory, which made every requires_item interaction fire the moment the item was picked up anywhere, whatever the player was actually doing with their hands.

§missing_item_hint: Option<String>

Diegetic feedback for a click that arrives without the required item in hand (DSL v0.7): narrated to that player in chat instead of the silence the gate used to answer with. Requires requires_item (DW0437).

Only fires while the objective is genuinely open — same activation gate as the affordance itself — so a finished or not-yet-active interaction stays quiet.

§prop: Option<Prop>

Prop block that IS the interaction affordance (DSL v0.4, spec-0008 §2): the compiler setblocks it at the anchor on activation (exactly as collect uses a real chest). Omitted = the glowing-lantern hologram marker (the v0.3 fallback).

§after: Vec<ObjectiveId>

Prerequisite objectives.

§requires_flags: Vec<FlagId>

Flags that must be set before this objective activates (v0.3).

§forbids_flags: Vec<FlagId>

Negative flag gate (DSL v0.6): the objective is suppressed (cannot activate or complete) while ANY listed flag is set for the player — the dual of requires_flags.

§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.

§stealth: bool

Bot stealth hint (DSL v0.4): mark this leg as one the critical-path bot should traverse sneaking (sprint disabled). Emitted into critical-path.json as sneak: true on the step. Purely a harness hint; no datapack effect.

§happening: Option<Happening>

What this objective does to the story (DSL v0.8, spec-0025; required at 0.8.0, DW0481).

Implementations§

Source§

impl Objective

Source

pub fn gate(&self) -> Gate<'_>

This objective’s whole gate, as one value (DSL v0.10).

Source§

impl Objective

Source

pub fn id(&self) -> &ObjectiveId

This objective’s id.

Source

pub fn after(&self) -> &[ObjectiveId]

This objective’s prerequisites.

Source

pub fn title(&self) -> Option<&str>

The short player-facing objective title (v0.3, optional).

Source

pub fn hint(&self) -> Option<&str>

The one-line location/direction hint (v0.3, optional).

Source

pub fn title_mut(&mut self) -> &mut Option<String>

Mutable access to the optional player-facing title (i18n localization).

Source

pub fn hint_mut(&mut self) -> &mut Option<String>

Mutable access to the optional one-line hint (i18n localization).

Source

pub fn requires_flags(&self) -> &[FlagId]

The flags that must be set before this objective activates (v0.3).

Source

pub fn forbids_flags(&self) -> &[FlagId]

The negative flag gate (DSL v0.6): flags whose being set suppresses this objective. The dual of Objective::requires_flags.

Source

pub fn requires_state(&self) -> &[StateCompare]

The numeric gate terms (DSL v0.10, spec-0031): comparisons that must hold before this objective activates. See StateCompare.

Source

pub fn happening(&self) -> Option<&Happening>

What this objective does to the story (DSL v0.8, spec-0025).

Source

pub fn stealth(&self) -> bool

The bot stealth hint (DSL v0.4): traverse this leg sneaking.

Source

pub fn collect_container(&self) -> Option<&AnchorId>

The container this objective ADOPTS (DSL v0.8), if it is a collect that declares one: the anchor whose prefab-placed chest/barrel it fills instead of conjuring its own chest. None on every other objective and on a collect that keeps the compiler-placed chest.

Source

pub fn collect_dropped_by(&self) -> Option<&WaveId>

The wave whose declared drops provide this objective’s item (DSL v0.9), if it is a collect that declares one. None on every other objective and on a collect fed by a container.

Source

pub fn collect_fill_count(&self) -> u32

The padding-stack count of a collect (DSL v0.8); 0 for every other objective and for a collect that fills the single required stack only.

Source

pub fn prop(&self) -> Option<&Prop>

The interact prop block (DSL v0.4), if this is an interact with a prop.

Source

pub fn kind(&self) -> &'static str

The kebab type tag.

Source

pub fn v03_verb(&self) -> Option<&'static str>

The v0.3 verb name if this objective is one of the verbs introduced in DSL v0.3 (kill/collect/interact). These validate in v0.3 campaigns .

Trait Implementations§

Source§

impl Clone for Objective

Source§

fn clone(&self) -> Objective

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Objective

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Objective

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Objective

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Objective

Source§

fn eq(&self, other: &Objective) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Objective

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Objective

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.