Skip to content

NPCs

NPCs in TerminaCraft are built from three plugins working together:

PluginRole
CitizensCreates the NPC entity, gives it a name and skin
SentinelAdds combat AI (used for hostile NPCs and guards)
DenizenAll behaviour — dialogue, movement, quests, reactions

How a typical NPC is set up

  1. Create the Citizens NPC/npc create <name>. This gives the NPC an ID.
  2. Assign a skin/npc skin <playername> or use SkinsRestorer for custom skins.
  3. Attach a Denizen assignment/npc assign --set <assignment_script>. The assignment script defines what the NPC does when clicked, spoken to, etc.
  4. Optionally attach a 3D model — use a Denizen adjust to 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.5

Sentinel NPCs should still have a Denizen assignment that guards against the gameplay_disabled flag for any scripted sequences they trigger.

Useful commands

CommandDescription
/npc listList all NPCs
/npc select <id>Select an NPC by ID
/npc tpTeleport to selected NPC
/npc tphereTeleport NPC to you
/npc skin <name>Set NPC skin to a player's skin
/npc assign --set <script>Attach a Denizen assignment
/npc removeRemove selected NPC

TerminaCraft — a Majora's Mask recreation in Minecraft