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 Feb 10, 2015Is this plugin abandoned? If so, I may fork an update onto spigot if that would please anyone.
-
View User Profile
-
Send Message
Posted Feb 3, 2015Yep, same issue as @Chakles. The NPC runs cmds twice.
-
View User Profile
-
Send Message
Posted Jan 29, 2015how to depict a player who clicks on npc? I need something / warp% playername% ... ... ...
-
View User Profile
-
Send Message
Posted Jan 27, 2015When I right click an npc it runs the command twice, Doesn't happens with the left click though.
I had a look at your code and I think you are missing a 'break' after the interact case in the click type config:
-
View User Profile
-
Send Message
Posted Jan 26, 2015Help Please!
[23:42:54 INFO]: caiomaximus issued server command: /kit tutorial [23:42:54 WARN]: [CommandNPC] Task #14690 for CommandNPC v1.5 generated an excep tion java.lang.NoSuchMethodError: org.bukkit.Server.getPlayer(Ljava/util/UUID;)Lorg/b ukkit/entity/Player; at me.messageofdeath.CommandNPC.Listener.NPCListener$1.run(NPCListener.j ava:62) [?:?] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftTask.run(CraftTask.java :53) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at org.bukkit.craftbukkit.v1_7_R1.scheduler.CraftScheduler.mainThreadHea rtbeat(CraftScheduler.java:345) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks ] at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:5 87) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:2 50) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.t(MinecraftServer.java:5 45) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.MinecraftServer.run(MinecraftServer.java :457) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks] at net.minecraft.server.v1_7_R1.ThreadServerApplication.run(SourceFile:6 17) [craftbukkit.jar:git-Bukkit-1.7.2-R0.2-b2974jnks]
-
View User Profile
-
Send Message
Posted Jan 1, 2015hello,
can i set some groups, who can use npc cmd ? can i set more cmd, which can use different groups ?
thanks :)
-
View User Profile
-
Send Message
Posted Dec 31, 2014@OTF_Catastrophe
Thanks and also, are you able to put blocks on npc's heads?
-
View User Profile
-
Send Message
Posted Dec 13, 2014@creeperandco101
There is a way to do this if you read the description.. You can use '%name' to get the user who is clicking the npc.
-
View User Profile
-
Send Message
Posted Dec 10, 2014Found an issue with this on Spigot 1.8 that is very unfortunate.
When right clicking an NPC that executes a command that will open an interface (GlobalMarket or BossShop) the interface is empty. If I left click the NPC it shows up correctly.
-
View User Profile
-
Send Message
Posted Dec 7, 2014is there a going to be an update where when they click npcs, the command can detect the players name? Example: /manuadd {player} Owner
-
View User Profile
-
Send Message
Posted Dec 7, 2014No Advertising Please
-
View User Profile
-
Send Message
Posted Dec 4, 2014Hey I love your plugin, been using it for a long time now aha. In the next update you should definitely add /server as a command to the NPC's.
-
View User Profile
-
Send Message
Posted Nov 24, 2014Hi My Friend Cant Install It I Dont Know Why
-
View User Profile
-
Send Message
Posted Nov 15, 2014Hi here is my video of your plugins in Spanish https://www.youtube.com/watch?v=Wopwfbl0PDE&list=UUZZg3bng4kzcaYDJR4amR_A Hola aqui esta mi video de tu plugin en español https://www.youtube.com/watch?v=Wopwfbl0PDE&list=UUZZg3bng4kzcaYDJR4amR_A Oi aqui é o meu vÃdeo do seu plugin em espanhol https://www.youtube.com/watch?v=Wopwfbl0PDE&list=UUZZg3bng4kzcaYDJR4amR_A
-
View User Profile
-
Send Message
Posted Oct 22, 2014A cool-down would be great!
-
View User Profile
-
Send Message
Posted Oct 8, 2014Good job ! Can you add cooldown between command for the next update ?
-
View User Profile
-
Send Message
Posted Oct 4, 2014I installed Citizens but it still comes up with "you need citizens installed to load CommandNPC" I need help!
-
View User Profile
-
Send Message
Posted Oct 4, 2014@renildomarcio
Hey renildomarcio, your answer is right in your error. The plugin requires another plugin in order to work properly. You need to install Citizens, which can be found here: http://dev.bukkit.org/bukkit-plugins/citizens/
Hope this helps.
-
View User Profile
-
Send Message
Posted Oct 4, 2014Erro Help!
06:36:09 [INFO] [CommandNPC] Enabling CommandNPC v1.7.2
06:36:09 [INFO] ---------------------{PaidRanks Error}---------------------
06:36:09 [INFO] Topic
06:36:09 [INFO] Required Dependencies
06:36:10 [INFO] Citizens.jar is not installed on the server! Shutting down.
06:36:10 [INFO] Class: CommandNPC Method: onEnable()
06:36:10 [INFO] ---------------------{PaidRanks Error}---------------------
06:36:10 [INFO] [CommandNPC] Disabling CommandNPC v1.7.2
-
View User Profile
-
Send Message
Posted Oct 3, 2014Can you play add a command where once you right click it, it plays a sound so you make something like this /npc addsound (sound) (volume) (pitch)