runebook · rune
runebook · rune
manifest: sha256:a78a9e60bc9661ee40c81e7d4952e6ae219987f0a46f3d643260a80496ea227a
rune add @rune/npcs@0.1.2Place persistent named villagers with click dialogue and an interaction event for quests, menus, and other Runes.
rune add @rune/npcs
Restart Paper. Stand where the villager should appear and run these
commands as an administrator with rune.admin.
/npc create guide Town Guide
/npc say guide Welcome to town!
| Command | Behavior |
|---|---|
/npc | List NPC IDs. |
/npc create <id> [title] | Create an NPC with a new ID at your location. |
/npc say <id> [line] | Set the dialogue or clear it by omitting the line. |
/npc remove <id> | Delete the definition and remove a loaded villager. |
IDs accept 1–24 letters, digits, underscores, or hyphens. Titles can be up to 64 characters and dialogue can be up to 300 characters.
Definitions store the world and position. Loaded NPCs are restored after restart and later chunks restore their NPCs on load. Remove loaded NPCs before uninstalling or restart Paper to discard their nonpersistent entities.
rune.events.on<{ npcId: string; playerId: string; playerName: string }>(
"npcs.interact",
({ npcId, playerId }) => {
const player = rune.player(playerId);
if (npcId === "guide") player?.sendMessage("Visit the market to begin.");
},
);
Use the server environment to set RUNE_NPCS_STORAGE to local,
reuse:shared, or connect. For connect, install the database adapter and set
RUNE_NPCS_DB_URL. The default keeps existing local data and otherwise prefers
an open connection when available. Storage setup