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 Mar 15, 2016TI
-
View User Profile
-
Send Message
Posted Mar 12, 2016@Trustinlies
Tested it...
-
View User Profile
-
Send Message
Posted Mar 4, 2016@Trustinlies
I have tested it. It seems to work fine for me :)
-
View User Profile
-
Send Message
Posted Mar 3, 2016@xDizasterCYx
@MJA2308
Have either of you tested it, or are we just assuming it doesnt work?
-
View User Profile
-
Send Message
Posted Mar 2, 2016@xDizasterCYx
Yeah where is it?
-
View User Profile
-
Send Message
Posted Mar 2, 2016Update for 1.9?
-
View User Profile
-
Send Message
Posted Feb 13, 2016Wish this was updated, it's very useful.
-
View User Profile
-
Send Message
Posted Feb 7, 2016This plugin is bugged in that it's associating a wrong NPC ID when setting a command (sometimes).
For example I set cmds on an NPC, delete him and recreate him. When I go to set cmds again I see in the commands.yml file that the command then becomes associated with an NPC ID that isn't being used by any NPCs on my server. If I try and change the yml file and reload it overwrites my changes with the wrong NPC ID again. Perhaps an issue with the NPC plugin itself and not this one?
Edit- No, it's this plugin. Citzens saves file clearly shows the NPC ID to be 19, but this plugin insists on putting "8" in its config for some unknown reason. Gonna have to deob and fix this myself.
Edit edit- This is actually really well-coded, kudos. I think the error may be in the CommandDatabase class but I'm not positive.
Edit edit edit- Ok, so looks like it must be pulling the UID from save files belonging to previous NPCs with the same name. Easiest way to remedy this is to check for the most recently created file associated with that player name.
-
View User Profile
-
Send Message
Posted Jan 30, 2016@Utmostmc
@EGX
proxy command NOT server command won't work.
-
View User Profile
-
Send Message
Posted Jan 30, 2016@Clix3D
/send is most-likely to be a proxy-command not a server-command.
-
View User Profile
-
Send Message
Posted Jan 29, 2016@Clix3D
"send" has to be a valid command on your server. Do /send "playername" "server" to check
-
View User Profile
-
Send Message
Posted Jan 26, 2016Hello there! I'm having some problems with clicking the npcs, some of them work just fine but others can only be used when left clicking. For some reason when you are OP you can do both, i would imagine it is a permission problem but it's not. All in all, if you aren't OP you are unable to right-click some npcs.
-
View User Profile
-
Send Message
Posted Jan 24, 2016/npc addcmd true noPerm send %name factions
Does that not work?
True = Sent in console
NoPerm = No Perms Needed
Send = send command in console (Send user to another user)
%name = Selected user in the send command
factions = desired server
Am I doing this wrong?
-
View User Profile
-
Send Message
Posted Jan 23, 2016@EGX
You're retarded, right? /server is proxy's command, not server's. Meaning, the player can only use it by himself.
-
View User Profile
-
Send Message
Posted Jan 7, 2016@Utmostmc
u have to put /npc addcmd false noperm (command)
-
View User Profile
-
Send Message
Posted Jan 4, 2016@assasinsheep
I got the same thing I fixed it by downloading it from bukkit and downloading citizens
-
View User Profile
-
Send Message
Posted Jan 4, 2016@messageofdeath
It doesn't work for me, I tried the perm node command and everything. here's what I put /npc addcmd true cod.join /cod join plz reply correct command
-
View User Profile
-
Send Message
Posted Jan 3, 2016Can you add a cooldown so the player won't spam the commands thanks :)
-
View User Profile
-
Send Message
Posted Dec 31, 2015amazing plugin but plz add more info ps how do i change the horse type to skeleton?
-
View User Profile
-
Send Message
Posted Dec 29, 2015Hello, great plugin, but it brakes deluxemenus. This is easily solvable by changing the option to op the player. At least make it possible with the console, since it makes no sense to give the player op, when the console is executing the command.
The reason it brakes is because deluxemenus uses permissions to display specific items for each player, and when using cmdnpc it brakes, because it gives op on menu open.
Thank you for reading, and please consider making the op player part optional.