NPCs
NPCs in TerminaCraft are built from three plugins working together:
| Plugin | Role |
|---|---|
| Citizens | Creates the NPC entity, gives it a name and skin |
| Sentinel | Adds combat AI (used for hostile NPCs and guards) |
| Denizen | All behaviour — dialogue, movement, quests, reactions |
How a typical NPC is set up
- Create the Citizens NPC —
/npc create <name>. This gives the NPC an ID. - Assign a skin —
/npc skin <playername>or use SkinsRestorer for custom skins. - Attach a Denizen assignment —
/npc assign --set <assignment_script>. The assignment script defines what the NPC does when clicked, spoken to, etc. - Optionally attach a 3D model — use a Denizen
adjustto set a ModelEngine model on the NPC entity.
NPC scripts
NPC behaviour scripts live in scripts/npc/. Each file typically contains:
- An assignment script — defines click handlers, proximity events, animation triggers
- A task script — the actual dialogue or action sequence called by the assignment
Example structure (scripts/npc/postman.dsc):
yaml
postman_assignment:
type: assignment
actions:
on click:
- run postman_dialogue
postman_dialogue:
type: task
script:
- if <server.flag[gameplay_disabled]> stop
- chat "Special Delivery!"
- ...Skin management
Player skins for NPCs are managed with SkinsRestorer. Custom skins (non-player skins) are stored in plugins/BetterModel/skins/ and applied via Denizen's adjust command.
Sentinel (combat NPCs)
Sentinel is used sparingly — mainly for hostile NPCs that need to chase or attack players. Sentinel config is stored per-NPC using Citizens' trait system. To set up basic combat behaviour:
/npc select <id>
/sentinel addtarget player
/sentinel range 10
/sentinel speed 0.5Sentinel NPCs should still have a Denizen assignment that guards against the gameplay_disabled flag for any scripted sequences they trigger.
Useful commands
| Command | Description |
|---|---|
/npc list | List all NPCs |
/npc select <id> | Select an NPC by ID |
/npc tp | Teleport to selected NPC |
/npc tphere | Teleport NPC to you |
/npc skin <name> | Set NPC skin to a player's skin |
/npc assign --set <script> | Attach a Denizen assignment |
/npc remove | Remove selected NPC |
