Set up CommandNPC on Minecraft
Run commands when players click a Citizens NPC: install Citizens and CommandNPC on Paper, add commands with flags and fix the usual problems.
CommandNPC runs commands when a player clicks a Citizens NPC. Use it for a shop NPC that opens a menu, a guide that sends players to a spawn, or a warp NPC that teleports them. It runs only on the server, so players install nothing.
Checked against CommandNPC 2.1.3, whose release notes say it updates the plugin to 1.19.3, with Citizens 2.0.44 build 4268, October 2026.
Read this first
Several unrelated plugins share the name CommandNPC. This guide covers the one by Bradydawg, which is on GitHub as Bradydawg/CommandNPC. It adds the /npc cmdadd command.
Its newest release is from December 2022 and targets 1.19.3. Citizens, the plugin it extends, is updated far more often. Its Spigot page lists Minecraft 1.7 to 1.19 as tested, and neither that page nor the release notes mention a newer version, so back up before you try it on one. If you want a version the author has tested, use the JAR Manager tab to pick one. Change your Minecraft version or mod loader shows how, and a version change reinstalls the server, so take a backup first.
What you need
- A Paper or Purpur server, which shows a Plugins tab under Content in the panel menu.
- Citizens 2. CommandNPC lists it as a required dependency and will not start without it.
- Vault and PlaceholderAPI are optional dependencies that CommandNPC lists. The price flag below charges a player only when Vault and an economy plugin that works with it are installed. Without them the price is ignored.
Install Citizens
Citizens is published on its SpigotMC page, and its Jenkins build server lists the builds at ci.citizensnpcs.co/job/Citizens2. The Plugins tab has no SpigotMC source, so upload the jar yourself:
- On your computer, download the Citizens jar.
- Open File Manager and go into the
pluginsfolder. - Click Upload and choose the jar. The browser limit is 100 MB per file, and Citizens is about 4 MB.
Install CommandNPC
CommandNPC has a jar on its GitHub release page, so the GitHub button in the Plugins tab can install it. The button needs the file access permission on the server:
- Open the Plugins tab and click GitHub.
- Enter
Bradydawg/CommandNPC, click Look up, then Next. - Pick the release listed as v2.1.3, which has the tag
2.1.3-alphabeside it, and click Next. The release has one jar,commandnpc-2.1.3.jar, so the panel skips the file choice and goes straight to the review step. - Click Install.
- Open Console and click Restart. The server needs a restart before a new plugin loads.
If the GitHub button is not available to you, download commandnpc-2.1.3.jar from the GitHub releases page and upload it to plugins in File Manager. The first start creates plugins/CommandNPC/config.yml.
Add a command to an NPC
Run these in game. You need citizens.npc.create to make an NPC and commandnpc.admin to add commands to one.
- Run
/npc create Guideto make an NPC. - If you made it earlier, select it with
/npc select <id or name>. - Run
/npc cmdadd -c say %name clicked the guide. The-cflag runs the command from the console.%nameis replaced by the name of the player who clicked. - Right-click the NPC to test it.
Commands you add are saved with the NPC. Flags that take a value, such as --v, start with two dashes.
Flags for /npc cmdadd
-cruns the command through the console, and-oruns it as an operator.-rpicks one random command from the NPC's list each time.--v <price>charges the player that amount first.--p <permission>requires the player to have that permission.--d <ticks>delays the command, and--cd <ticks>sets a cooldown. Twenty ticks is one second.--t <left|right|both>chooses which click triggers it. The default comes fromconfig.yml.
Manage an NPC's commands
/npc cmdinfolists the commands on the selected NPC with their IDs./npc cmdset <id> ...changes a command's flags./npc cmdremove <id>removes one command, and/npc cmdresetremoves them all.
Settings
When it first starts, CommandNPC writes its config.yml itself, filled with these defaults:
ClickType: bothsets which click triggers an NPC. The values are both, left and right.CoolDown: 20is the pause, in ticks, before a player's next click on an NPC counts, to stop spam. Twenty ticks is one second.ExecuteCommandMessage: falsestops the plugin sending a success message to the player after a command runs. Set it totrueto turn the message on.BungeeCord: falseis off by default. Set it totrueto let commands such asserver <name>send players to another server on a proxy.CooldownMessage: truetells a player who clicks too soon that they are cooling down.CheckForUpdates: truechecks for updates and notifies you.
Open config.yml in File Manager, change a value and click Save, then run commandnpc reload in the Console to reload the plugin. The command needs commandnpc.admin or operator status, and the console counts as an operator.
Common problems
- Nothing happens when you click. Check that Citizens is in the Installed view and that the NPC is the selected one when you run
/npc cmdinfo. - The plugin does not load. Look in the Console for the first error. CommandNPC needs Citizens and was last released for 1.19.3.
- A flag is ignored. Flags with a value need two dashes, such as
--cd 100. config.ymlwill not load. See How to find and fix YAML and JSON config errors.
Was this guide helpful?
Related guides
Set up Citizens on your Minecraft server
Upload the Citizens NPC plugin, pick the build for your Minecraft version, create NPCs with /npc commands and set permissions.
Get modpack features with Paper plugins
Match common modpack features such as claims, quests and vein mining to Paper plugins that need no client mods, and see what has no plugin equivalent.
Protect your builds with GriefPrevention
Install GriefPrevention so players claim land with a golden shovel, share it with /trust and stop griefing without admin work.
