pub struct Npc {
pub id: NpcId,
pub name: String,
pub role: Role,
pub area: AreaId,
pub anchor: AnchorId,
pub offset: [i32; 3],
pub base_entity: String,
pub persona: Persona,
pub skin: Option<NpcSkin>,
pub deferred: bool,
pub traversal: Option<BodyTraversal>,
}Expand description
A stationary NPC bound to an area anchor (a casting sheet, spec-0001 v0.2).
Stage 2 carries no dialogue — the structured Persona is the character
contract the stage-6 dialogue tree must honor.
Fields§
§id: NpcIdUnique NPC id.
name: StringPlayer-facing name.
role: RoleNPC role.
area: AreaIdThe area this NPC stands in (stage-1 ref).
anchor: AnchorIdThe prefab anchor this NPC stands on.
offset: [i32; 3]Integer [x, y, z] block offset from anchor (spec-0066, default
[0, 0, 0]): the NPC stands at the Mark the two fields spell.
base_entity: StringThe vanilla entity to re-dress, e.g. minecraft:villager.
persona: PersonaThe structured persona (character contract for stage 6).
skin: Option<NpcSkin>Optional player-model skin (DSL v0.4, spec-0008 §6 / spec-0009). When set,
the compiler emits a minecraft:mannequin body carrying this skin profile
instead of re-dressing base_entity; the interaction hitbox is unchanged.
Non-skinned NPCs are byte-identical to v0.3.
deferred: boolDeferred entrance (DSL v0.6): when true the NPC is not summoned at
world init — its body and interaction hitbox only appear when a
Verb::SpawnNpc fires, at this same anchor. The dual of
despawn-npc: a character with a scripted entrance must not stand at its
mark as a statue from minute one. A deferred NPC that no spawn-npc ever
spawns is unreachable content (DW0197). Default false = summoned at
init, byte-identical to pre-0.6.
traversal: Option<BodyTraversal>What this body can do when it moves (DSL v0.11, spec-0034). Absent = the
class the compiler derives from base_entity (or from minecraft:mannequin
when skin is set — the body that actually ships). See BodyTraversal:
the declaration must change a verdict or it is DW0454, and it can never
reach the error tier.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Npc
impl<'de> Deserialize<'de> for Npc
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 Npc
impl JsonSchema for Npc
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