NPC Vendor
clickNPC from Citizens is a popular activator on RPG servers. The player walks up to a vendor NPC, right-clicks, and a shop menu opens. The menu can read NPC context via %activator_npc_*% placeholders - this example puts the NPC’s name in the menu title for a personal-feeling vendor.
What it teaches
Section titled “What it teaches”- The
clickNPCactivator with a Citizens NPC ID - The
%activator_npc_name%placeholder for personalized titles - How activator-context placeholders propagate through to menu items
This activator only works when Citizens is installed and at least one NPC exists with the specified ID. To find a NPC’s ID:
- Look at the NPC.
- Run
/npc sel. - Run
/npcto see selected NPC info, including ID.
Replace clickNPC: [1] with your actual NPC ID. For multiple NPCs that all open the same shop:
clickNPC: [1, 5, 12]NPC context placeholders
Section titled “NPC context placeholders”Inside the menu, %activator_npc_*% exposes the clicked NPC:
| Placeholder | Returns |
|---|---|
%activator_npc_id% | Numeric NPC ID |
%activator_npc_name% | NPC’s display name |
%activator_npc_world% | World the NPC is in |
The example uses %activator_npc_name% in the title, so the menu title becomes “Trader BlacksmithBob” or whatever the NPC is named.
Why this beats command: for vendors
Section titled “Why this beats command: for vendors”A /shop command is universal - everyone uses the same syntax to open the same menu. A right-click on an NPC ties the shop to a specific in-world location and gives the vendor visual personality. Players also can’t accidentally open the shop from anywhere - they have to physically walk to the NPC. Better roleplay, less command spam.
For a hybrid (open via NPC click OR command), put both in the activators block:
activators { command: "ame_vendor" clickNPC: [1]}Try it
Section titled “Try it”- Install Citizens.
- Spawn an NPC:
/npc create Bobthen look at it,/npc sel,/npcto confirm ID. - Drop the bundle into
plugins/AbstractMenus/menus/example/. UpdateclickNPC: [1]to your NPC’s ID. /am reload.- Right-click the NPC.