Skip to main content

Actor

Struct Actor 

Source
pub struct Actor {
Show 15 fields pub id: ActorId, pub entity: String, pub name: Option<String>, pub skin: Option<NpcSkin>, pub anchor: AnchorId, pub offset: [i32; 3], pub facing: Option<Facing>, pub vulnerable: bool, pub equipment: Option<MobEquipment>, pub attributes: Option<MobAttributes>, pub tier: Option<EncounterTier>, pub health_bar: Option<HealthBar>, pub drops: Vec<MobDrop>, pub traversal: Option<BodyTraversal>, pub on_kill: Option<OnKill>,
}
Expand description

A scripted stage actor (DSL v0.6, spec-0014): a NoAI/Silent/no-loot puppet, distinct from a stage-2 Npc (no dialogue, any mob type). Emitted with tag dw_actor_<id>, Invulnerable unless vulnerable (a damageable puppet stays knockback-immune — the tower-defense creep). skin re-dresses it as a minecraft:mannequin, exactly as a stage-2 NPC skin. The puppet is summoned by a spawn-actor effect (not at load), moved by move-actor, and can be replaced by a real-AI twin with unleash-actor.

Fields§

§id: ActorId

Unique actor id (actor/<kebab>).

§entity: String

The vanilla entity to puppet, e.g. minecraft:warden. Validated against the pinned 1.21.11 entity registry (DW0173).

§name: Option<String>

Optional custom name shown above the puppet.

§skin: Option<NpcSkin>

Optional player-model skin (mannequin), as a stage-2 NPC (DW0190).

§anchor: AnchorId

The anchor the puppet is summoned on (resolved across areas, like an open-gate / move-npc destination).

§offset: [i32; 3]

Integer [x, y, z] block offset from anchor (spec-0066, default [0, 0, 0]): the puppet stands at the Mark the two fields spell, so a rank of bodies is one anchor and an offset apiece.

§facing: Option<Facing>

Initial facing (default south). The puppet spawns yawed this way.

§vulnerable: bool

If true, the puppet is damageable (a tower-defense creep) but stays knockback-immune; default false (fully Invulnerable).

§equipment: Option<MobEquipment>

Gear the actor wears and holds, in the same shape a wave mob uses (MobEquipment). Emitted into BOTH the staged puppet and the unleashed twin, so the dormant elite the player has been circling is visibly the same armoured thing that stands up. Drop chances are zero — wave gear and actor gear are never farmable (no-grind constitution).

§attributes: Option<MobAttributes>

Attribute overrides, in the same shape a wave mob uses (MobAttributes, the v0.4 surface — one type, one rule set, so the two surfaces cannot drift). Emitted into BOTH the staged puppet and the unleashed twin, so the elite the party fights is the elite the author tuned; without it an actor was stuck at vanilla base values while every wave mob could be tuned, which is what blocked elite authoring. A vulnerable actor’s knockback-immunity is emitted first and is not authorable.

§tier: Option<EncounterTier>

How hard this actor’s fight is meant to be (DSL v0.8, spec-0023) — the same EncounterTier vocabulary a Wave declares. Absent = EncounterTier::Ordinary, byte-identical to every pre-0.8 campaign.

A wave is not the only shape an elite takes. The set-piece souls fight — the armoured thing kneeling among the graves that stands up when you hit it — is an actor: staged by spawn-actor, given AI by unleash-actor, killed by hand rather than by a kill objective. Before this field nothing anywhere stated what such a fight was billed as.

Like the wave field this is a declaration, not a knob: the compiler never scales an actor from it, and emission is unchanged whichever tier is declared. Its readers are the health-bar advisory (DW0912) and the drop rule — only a billed fight leaves anything behind.

§health_bar: Option<HealthBar>

A health bar over this actor’s fight (DSL v0.31, spec-0073) — the same HealthBar a Wave declares. It reads the bodies whose health can move: the unleashed twin, or the puppet itself when the actor is vulnerable. A bar on an actor that is neither is DW0909. Absent = no bar, byte-identical.

§drops: Vec<MobDrop>

What this actor leaves behind when a player kills it. Only an elite/boss actor may declare it (DW0491). Emitted into BOTH the staged puppet and the unleashed twin, exactly as equipment is — the drop belongs to the body, not to one of its two lifecycles. A despawn-actor strips the declaration off the body before removing it, so re-caging an elite (a souls re-seat) never scatters its axe.

§traversal: Option<BodyTraversal>

What this body can do when it moves (DSL v0.11, spec-0034) — the same BodyTraversal a stage-2 Npc carries, because traversal belongs to the body and not to the stage that declares it. Absent = the class the compiler derives from entity (or from minecraft:mannequin when skin is set).

§on_kill: Option<OnKill>

What happens each time a player is credited with killing this actor’s body (spec-0074) — effect root R9, the same OnKill a wave declares. Absent = no bundle, and the actor’s emission is byte-identical.

Trait Implementations§

Source§

impl Clone for Actor

Source§

fn clone(&self) -> Self

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 Actor

Source§

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

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

impl<'de> Deserialize<'de> for Actor

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 Actor

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 Actor

Source§

fn eq(&self, other: &Self) -> 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 Actor

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 Actor

Auto Trait Implementations§

§

impl Freeze for Actor

§

impl RefUnwindSafe for Actor

§

impl Send for Actor

§

impl Sync for Actor

§

impl Unpin for Actor

§

impl UnsafeUnpin for Actor

§

impl UnwindSafe for Actor

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.