CONTENT CONTRACT · VERSION 1
StructureView
A building or placed structure as the snapshot saw it: players' structures (`actor/s<id>`) and the map's village buildings (`actor/b<owner>`) alike.
Signature
{ definition: StructureId, finished: boolean, health: HitPoints, inside: {StructureContent}, max_health: PositiveHitPoints, owner: (StructureOwner)?, position: Position, ref: ActorRef, residents: {NpcId}, stored: {ItemStack} }Fields
| Name | Type | Meaning |
|---|---|---|
definition | StructureId | Its structure definition. Length: 1…129; Pattern: ^[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95}$; Reference: structure |
finished | boolean | False while it is a foundation still being raised by the hammer. |
health | HitPoints | Current hit points; below max_health it is damaged (a broken building has 0). Range: 0…2147483647; Unit: hp |
inside | {StructureContent} | What stands in its room (a tent's sleeping bag, a house's chest), in reference order. Items: 0…64 |
max_health | PositiveHitPoints | Hit points of the intact structure. Range: 1…2147483647; Unit: hp |
owner | StructureOwner | Who owns it (`claim_structure`): an NPC or `players`; absent: free. Length: 1…129; Pattern: ^(?:players|[a-z][a-z0-9_]{0,31}:[a-z][a-z0-9_]{0,95})$ |
position | Position | Where it stands (its anchor point). |
ref | ActorRef | The structure as an actor reference. Length: 1…256; Pattern: ^[\s\S]+$ |
residents | {NpcId} | The NPCs whose home it is (`set_home`), in reference order; it is theirs. Items: 0…64 |
stored | {ItemStack} | What its storage holds (a chest), by item. Items: 0…64 |