Skip to main content

NPCs

NMEntitiesAPI.npcs() identifies NPC entities in the world and looks up their definitions.

Editing NPCs

ops() is the same surface the /npc commands use, so an addon and an admin produce identical results:
ops() is null only while the platform is still enabling. Check it if you call during startup.
To replace what a right-click does rather than edit the NPC, cancel NpcInteractEvent.

Dialogs

Branching conversations from Dialogs/ can be driven from code: start one from an item use, a region enter, a quest step.
ids() and get(id) are there too. The NPC argument is optional, so a dialog doesn’t have to belong to an NPC at all.

Dialogs speak the same effect DSL

Custom conditions you register are immediately usable in dialog conditions: blocks, and custom mechanics in dialog node effects:. Nothing extra to wire up. See NPC Dialogs and Dialog Conditions for the config side.