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.
1.13 Please
update 1.13+
this is awesome! i hope it works in 1.13.X! has anyone tested it?
Hello creators i have problem with command /npc cmdadd false noperm lobby can you answer how i can do it
In reply to Forge_User_15340444:
So first off all this is a really cool plugin and idk why people are hating on it.
I myself have also run into a bug, I can't right click the npc to run the cmd but I can left click. Is there a fix for this?
Details:
MC version: 1.7.10
Server Jar: Latest Thermos
Citizens version: Special thermos (2.0.13-1.7.10-Cauldron-B2)
cmd npc version: 1.9.1
help I have a problem when I write NPC cmdadd and command gives me an error
Doesn't work with 1.13
I am using the MultiVerse Core plugin and I do /npc cmdadd %name mvtp SkyblockWhiteLobby with an NPC selected, and when I click the NPC it says "You cannot do this yet!". Did I do the arguments wrong? Please help!
What command would I use to add someone to a permissions group? (I'm using pex)
I have tried a few times and cant work it out.
Please help
HI,I don't know how to make an npc un-moveable also with a fishing rod
TO ANYONE WHO IS CONFUSED WITH THIS PLUGIN READ WHAT I HAVE TO SAY BECAUSE I CAN FIX IT.
IF YOU ARE CONFUSED, YOU PROBABLY USED A COMMAND LIKE THIS
/npc cmdadd false noperm fly
WHAT YOU SHOULD USE IS:
/npc cmdadd fly
THIS WILL RUN THE COMMAND AND YOU WONT GET YOU CANNOT DO THIS YET.
In reply to JayMan4063:
[commandnpc] You have set the following variables:
- command to: /island
this is what i have set but when i click on the npc it shows this:
you cannot do this yet
what is wrong? or what did i wrong i used the /npc cmdadd and after that the /npc cmdset
I have the same problem, non ops are getting the no permission error when trying to use the commands to simply skin the npc thanks in advance for any help
Can someone tell me what is wrong here. I have this all coded and it works correctly. However non ops dont have permissions when they click on the NPC?
SavedNPCs:
'65':
cooldown: 0
customPerms: noPerms
commands: tellraw @p ["",{"text":"=============================================","color":"light_purple","bold":true,"strikethrough":true},{"text":"Greetings
traveller. I am the","color":"none","bold":false,"strikethrough":false},{"text":"
Supreme Herobrine.","color":"red"},{"text":" I am the custom boss mob of InsanityCraft
and I'm found in my temple that spawns randomly and rarely around the world.
Kill me to receive INCREDIBLE rewards and have your name placed on the","color":"none"},{"text":"
/story.","color":"green"},{"text":" Right click any of the other NPCs here to
see their info. Our website has much more information about all of the custom
mobs and builds. Simply click here ---> ","color":"none"},{"text":"https://goo.gl/ydRae1","color":"green","clickEvent":{"action":"open_url","value":"https://goo.gl/ydRae1"}},{"text":"=============================================","color":"light_purple","bold":true,"strikethrough":true}]
How to I select the nearest player, or the who run the command? PLS <3
i have an problem i can't do /npc cmdadd [CMD]
or /npc cmd
please fix it !!
Dude, please fix this plugin. It's wiping the commands.yml cfg almost every day now.
Hello, I need help:
I would like to provide the NPCs with a / warp command.
Whats the best way to do this ?