CommandNPC
CommandNPC is a plugin inspired by the server Mineplex, which adds a new function to NPCs. It allows users to run commands by simply right clicking on a Citizens NPC. Requires Citizens 2! Now requires Java 8
Commands and Permissions
(Now supports PlaceholderAPI)
To set up the npc with the commands you need the permission 'commandnpc.admin'
Be aware that flags that require additional input like [--v price], you need 2 dashes(-)!
-
/npc cmdadd [-c console] [-o Op] [-r random] [-i ignorePermMsg] [-l ignoreMoneyMsg] [--v price] [--t clickType] [--d delay] [--cd cooldown] [--p custom.permission.node] <command...> - Add a command to be executed upon clicking the selected NPC.
-
The -c flag runs the command through the console.
-
The -o flag runs the command as an op.
- The -r flag picks a random command and executes that one command only.
- The -i flag when true, noPerm message doesn't send
- The -l flag when true, noMoney message doesn't send
- The --v flag charges the player the specified amount, when running the command. (Numeric with decimal)
-
The --p flag requires the player to have the specified permission.
- The --d flag is the amount of ticks that the command will be delayed by. (Integer input)
- The --cd flag is a cooldown for the command in ticks. (20 ticks in a second)
- The --t flag sets the clickType('left', 'right', or 'both') | This will default to the global setting in config.yml
-
-
/npc cmdinfo [id] - Gets various information about all the NPC commands
-
If you include the command 'id' it will only show information for that command.
- You get the 'id' from using the 'cmdinfo' command
-
-
/npc cmdremove <id> - Removes a specific command
- You get the 'id' from using the 'cmdinfo' command
-
/npc cmdset <id> [-c console] [-o Op] [-r random] [-m cdMsg] [-i ignorePermMsg] [-l ignoreMoneyMsg] [--v price] [--t clickType] [--d delay] [--cd cooldown] [--p custom.permission.node] [command | cdMsg...] - Set various variables for the command
-
The -c flag runs the command through the console. (This will toggle between true/false)
- The -o flag runs the command as an op. (This will toggle between true/false)
- The -r flag picks a random command and executes that one command only.
- The -m flag is when you have a cooldown amount specified. When the player is in a cooldown and attempt to use the NPC, it will send them this message. (Usage: /npc cmdset -m [cdMsg...]) Note: When using other flags the cdMsg as to be the last things within the command.
- The -i flag when true, noPerm message doesn't send
- The -l flag when true, noMoney message doesn't send
- The --v flag charges the player the specified amount, when running the command. (Numeric with decimal)
- The --p flag requires the player to have the specified permission.
- The --d flag is the amount of ticks that the command will be delayed by. (Integer input)
- The --cd flag is a cooldown for the command in ticks. (20 ticks in a second)
- The --t flag sets the clickType ('left', 'right', or 'both')
- You get the 'id' from using the 'cmdinfo' command
-
-
/npc cmdreset - Remove all commands from the selected NPC.
-
You can use '%name' in commands as a placeholder for the user who is clicking the NPC.
- This plugin now supports a BungeeCord command. You may now use 'server <serverName>' to teleport people between servers!
How to setup the NPC
-
Edit config.yml to your likings
-
Select the NPC you wish to add commands too.
-
Use the command 'cmdadd' (Syntax listed above) to add the commands you wish.
-
These commands will be saved.
-
If you wish to remove the commands simply use the 'resetcmds' command. (Syntax listed above)
Metrics by bStats
Github
===== Donations =====
If you like what you see and want to support the development of this plugin and any other plugins I decide to create, you can donate to the developers! Just check the upper right of the page.
-
View User Profile
-
Send Message
Posted Jan 26, 2022Does this work on version 1.18.1?-
View User Profile
-
Send Message
Posted Dec 14, 2021does this work in 1.18?
-
View User Profile
-
Send Message
Posted May 5, 2021working for me on 1.8.8 :)
-
View User Profile
-
Send Message
Posted Mar 24, 2021pls update 1.16.5
-
View User Profile
-
Send Message
Posted Jul 6, 2020does this work in 1.16.1?
-
View User Profile
-
Send Message
Posted Aug 14, 2020In reply to Leatyy:
Yep men, that work on 1.16.1 (Just look the commands on external website because the help of the plugin doesn't work for myself x')
-
View User Profile
-
Send Message
Posted May 28, 2020I am in 1.12.2
-
View User Profile
-
Send Message
Posted Jan 31, 2021In reply to djcgame:
I am using 1.12.2 just do /npc cmdadd --t both --d 0 say hi
-
View User Profile
-
Send Message
Posted Jan 31, 2021In reply to darkwolfie_37:
the --t is for what click.
-
View User Profile
-
Send Message
Posted May 28, 2020No commands are working for me not even /say hi
-
View User Profile
-
Send Message
Posted Apr 17, 2020Good!It's useful for developers and some server.I wanted to mark 50starsbut only 5.May I reposted it to mcbbs.net(The biggest forum of China)?I'll mark the original page and source code page.Look forward.Thanks!
-
View User Profile
-
Send Message
Posted Mar 22, 2020Hey, guys! I want to make a npc run the comand /shop. i tried to make it run as an op, because i dont want to give this permission to default players so they have to go /warp shop and click the npc, there fore only higher ranks will be allowed tp simply tipe in chat /shop to aces it. Going back. When i set the npc with "/npc cmdadd -o shop" and is telling the non-op players that they dont have the permisson. But is od because i did the same with a npc and set it wp with "/npc cmdadd -o disposal" without giving the default players the permision to do it just by typeing in chat, but clicking on the npc works. Can any1 help me with this ? Thanks in advance
-
View User Profile
-
Send Message
Posted Jan 31, 2021In reply to Forge_User_69530624:
This might be due to not having op perms. this also can have been done by not having the /shop command permission. If you need further asstiance, please contact me at darkwolfie@darksmp.com for more info.
-
View User Profile
-
Send Message
Posted Mar 4, 2020Can someone please tell me how to add a command with a space??? Im trying /npc addcmd false noperm moneypouch_list but it doesnt work.
-
View User Profile
-
Send Message
Posted Dec 28, 2019look's cool I will use it on my sever
-
View User Profile
-
Send Message
Posted Aug 11, 2019So i am trying to make a NPC open a Shop GUI with /shop Librarian. Now i did /npc cmdadd shop Librarian and it says it is set but unlike other errors it doesn't show the "/help" error message instead it does nothing. I am using Ultimate Economy and Citizens 2 as well
-
View User Profile
-
Send Message
Posted Jan 5, 2020In reply to HawkI64:
Try /npc cmdadd -c sudo %name shop Librarian.
this will fix it
-
View User Profile
-
Send Message
Posted Feb 23, 2019The commands aren't working on my 1.8-1.8.9 Bukkit Server! What do I do?
-
View User Profile
-
Send Message
Posted Jun 12, 2020In reply to spectthespider1:
Mine also, i'll love to get it solved (:
-
View User Profile
-
Send Message
Posted Jan 31, 2021In reply to spectthespider1:
this is may be due to that citizens plugin you have isnt for 1.8.9 or the command plugin isnt 1.8.9. Please use the File tab at the top of this page to find the right version for your Minecraft server.