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 Jul 30, 2014@messageofdeath
Oh Ok :)
-
View User Profile
-
Send Message
Posted Jul 30, 2014Thx messageofdeath!
-
View User Profile
-
Send Message
Posted Jul 29, 2014@messageofdeath Permissions are'nt working , people can use the npc no matter what if they dont have the permissions or not. /npc addcmd false sensationkits.kit.marksman selectkit Marksman Even without that permission they can still use it
-
View User Profile
-
Send Message
Posted Jul 29, 2014Would it be possible to give the person more than one command
-
View User Profile
-
Send Message
Posted Jul 28, 2014@Victhetiger
I don't think that's possible with the current API.
-
View User Profile
-
Send Message
Posted Jul 28, 2014@iTossico
"<customPerms(noPerm)>" - is really just for advanced users that want to add permission in order to use the npc
"<in console(true/false)>" - Is wheither or not you want the command to run in console(true) or runned by the player(false)
-
View User Profile
-
Send Message
Posted Jul 27, 2014It Would Be Great if, When you Right Click the Mob Your Arm Actually Moves, Like when you right click a Fence or a Button :P
-
View User Profile
-
Send Message
Posted Jul 26, 2014This might be a stupid question but I don't really know how to use your plugin, like I don't what to put into the "customPerms(noPerm) and I don't know what "in console (true/false)". The video you linked is for an older version and I cant find a new video on YouTube. So it would be great if someone could help me, Thank You!
-
View User Profile
-
Send Message
Posted Jul 25, 2014@U1T1MATE
Add me on skype and we'll to the bottom of this. Skype: messageofdeath
-
View User Profile
-
Send Message
Posted Jul 24, 2014For some reason, the permissions aren't working. I've done /npc addcmd false getpet.gold pet ocelot:baby
However, even those without the "getpet.gold" permission are able to use the NPC... Mind helping out?
-
View User Profile
-
Send Message
Posted Jul 21, 2014@messageofdeath
There are no console errors.
-
View User Profile
-
Send Message
Posted Jul 21, 2014@acaweafaw
This seems like a problem with the plugin?
-
View User Profile
-
Send Message
Posted Jul 21, 2014@messageofdeath
My problem is that when the command is:
/npc addcmd false kit.epic kit epic - the kit cooldown from the kit plugin is not working and you can get it unlimited times.
When its: /npc addcmd true kit.epic sudo %name kit epic - Its working correctly but when I restart the server its not working anymore.
-
View User Profile
-
Send Message
Posted Jul 20, 2014@acaweafaw
I don't exactly know what you mean.
-
View User Profile
-
Send Message
Posted Jul 20, 2014@messageofdeath
I update and do the commands again. The problem is that I use essentials and I have cooldonws, but with the npc cooldown not working. Samo for permissions. I don't have the needen permission, but I can have it from the npc. My command is:
/npc addcmd false kits.hero kit hero
I reset the npc command before add the new.
And when I use it from essential it says that I can use it after xx time.
I try and fix it. I type it: /npc addcmd true kit.epic sudo %name kit epic
-
View User Profile
-
Send Message
Posted Jul 19, 2014@FeroxzPlays
Make sure to not put the / in the command. It is automatically added
-
View User Profile
-
Send Message
Posted Jul 19, 2014@acaweafaw
This plugin is not compatible with your version of Bukkit. 1.7.2 doesn't have the UUID implemented into the API for getPlayer(). Which is why it gives NoSuchMethodError. Try using 1.7.9
-
View User Profile
-
Send Message
Posted Jul 19, 2014I have a problem. I have a kit pvp server and there are kits, but when a player click a kit, that he don't have permission for he get it. I set 2 permissions - from the kit plugin and from cmdnpc to be kits.kitname and they dont have it. When they type /kit kitname they cant get it - to get it is possible only from the npc. It shows a error in the console:
[01:46:37] [Server thread/WARN]: [CommandNPC] Task #322 for CommandNPC v1.5 generated an exception
java.lang.NoSuchMethodError org.bukkit.Server.getPlayer(Ljava/util/UUID;)Lorg/bukkit/entity/Player;
at me.messageofdeath.CommandNPC.Listener.NPCListener$1.run(NPCListener.java:62) ~[?:?]
at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java:53) ~[craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:587) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:545) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java:457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:617) [craftbukkit.jar:git-Bukkit-1.7.2-R0.3-b3020jnks]
-
View User Profile
-
Send Message
Posted Jul 19, 2014@messageofdeath
OMG! That New Version is Awesome! My Players can now access the Enjin Shop from an NPC! Thanks A Lot! :D
-
View User Profile
-
Send Message
Posted Jul 17, 2014@messageofdeath
Tested the new version. For me nothing changed, I still can't use /server or commands from MyCommand.