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 Sep 29, 20141.7.10 plz sorry! D:
-
View User Profile
-
Send Message
Posted Sep 27, 2014Yes it's work normal commands but I I not get it to work with bungee cord. Normal command is /server example but with npc I use "/npc addcmd false noPerm server example" is not work. Thanks =)
-
View User Profile
-
Send Message
Posted Sep 26, 2014@JavituRec
/npc addcmd <in console(true/false)> <customPerm(noPerm)> <command>
Your forgetting the customPerm option. If you do not wish to add a permission just fill it in with noPerm
-
View User Profile
-
Send Message
Posted Sep 26, 2014and actualize not I get the error but now the command is executed only if the user has no op if nothing happens not even agrege permission and remains the same.
-
View User Profile
-
Send Message
Posted Sep 25, 2014Hi, i have a problem. When i created npc, I put command -> "/npc addcmd false server hub" and not work. I too put command -> "/npc addcmd false spawn" and not work. I use spigot 1.7.9... What is the problem?, I have done like the tutorial video and not work. :(
-
View User Profile
-
Send Message
Posted Sep 25, 2014@messageofdeath
ok thanks. just wasnt sure if there was a way to not let players make the npcs
-
View User Profile
-
Send Message
Posted Sep 24, 2014@_elements
@_elements
Not exactly I make the player send it through chat. So basically it should get picked up by anything being ran by the command. It simulates that the player typed it in chat as a command.
-
View User Profile
-
Send Message
Posted Sep 24, 2014@NickX56
From the looks of it your server is 1.7.2. You have to update to the most recent version of bukkit in order to use it due to the changes with the UUID's
-
View User Profile
-
Send Message
Posted Sep 24, 2014@CrashBandiMan
/server is a Bungee command, its taken in through the proxy. However sense the player isn't actually sending then command by the client, Bungee doesn't pick it up. Only fix for this would be for him to add a messenger to Bungee.
-
View User Profile
-
Send Message
Posted Sep 24, 2014hmmm. it seems /server {server name} doesn't work. but other Cross-Server commands like /hub does work ._. am i doing something wrong?
-
View User Profile
-
Send Message
Posted Sep 22, 2014every time someone uses it get this: Just for the permit?
-
View User Profile
-
Send Message
Posted Sep 21, 2014@NickX56
To answer the second part of the question its configurable in the config file. Can you give me the error output please? That will help a lot when going to fix it.
-
View User Profile
-
Send Message
Posted Sep 21, 2014@Derekd98
commandnpc.admin
-
View User Profile
-
Send Message
Posted Sep 21, 2014I have a question I put the command in the npc and use it but when a person who has no op command on the console works but get an error not damage anything but it bothers me some to and permission to use the right click on the npc ?. thanks
-
View User Profile
-
Send Message
Posted Sep 21, 2014Ok just answer this. What permissions are needed for a player to use an NPC with a command on it?d
Maybe that will be easier to answer
-
View User Profile
-
Send Message
Posted Sep 16, 2014@DuskFireHD
I can add that in the future
-
View User Profile
-
Send Message
Posted Sep 16, 2014is there anyway I can a timmers before the command is executed
-
View User Profile
-
Send Message
Posted Sep 15, 2014@Derekd98
Make sure the plugin is enabled. After that i'm not sure what's wrong. Also ensure your setting it up on the correct NPC.
-
View User Profile
-
Send Message
Posted Sep 14, 2014Hello? Anyone know how to solve my problem below?
-
View User Profile
-
Send Message
Posted Sep 7, 2014@messageofdeath
Sorry I understand the problem now, you cannot use player.hasPermission if you do not know the permission node to check for.