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 May 1, 2017Is the latest working for anyone? Seems to be totally broken.
-
View User Profile
-
Send Message
Posted May 1, 2017In reply to Jeruhmi:
-
View User Profile
-
Send Message
Posted May 1, 2017In reply to Jeruhmi:
-
View User Profile
-
Send Message
Posted Apr 29, 2017I'm having an issue where villagers will not run the commands assigned to them, however any other mob works perfectly fine. I'm not sure if this is an issue with CommandNPC or Citizens, would appreciate some help.
Thanks
-
View User Profile
-
Send Message
Posted Apr 30, 2017In reply to Forge_User_91801677:
-
View User Profile
-
Send Message
Posted Apr 30, 2017In reply to messageofdeath:
commands
NPCS: '1': Commands: - menu~~-cfalse~false~0.0 '2': Commands: - menu~~-cfalse~false~0.0 '3': Commands: - blacksmithrepair~~-cfalse~false~0.0Config
ClickType: Interact
CoolDown: 20
Error
30.04 21:20:12 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]
30.04 21:20:12 [Server] INFO at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]
30.04 21:20:12 [Server] INFO at sun.reflect.GeneratedMethodAccessor154.invoke(Unknown Source) ~[?:?]
30.04 21:20:12 [Server] INFO at com.hihihih565.EventListener.onInteractEntity(EventListener.java:139) ~[?:?]
30.04 21:20:12 [Server] INFO Caused by: java.lang.NullPointerException
30.04 21:20:12 [Server] INFO at java.lang.Thread.run(Unknown Source) [?:1.8.0_45]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:747) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_45]
30.04 21:20:12 [Server] INFO at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_45]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.PacketPlayInUseEntity.a(SourceFile:13) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.PacketPlayInUseEntity.a(SourceFile:69) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1536) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
30.04 21:20:12 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[minecraft_server.jar:git-Spigot-54ec0b8-e04a179]
-
View User Profile
-
Send Message
Posted Apr 30, 2017In reply to Forge_User_91801677:
-
View User Profile
-
Send Message
Posted Apr 30, 2017In reply to messageofdeath:
-
View User Profile
-
Send Message
Posted Apr 28, 2017After the new update, i can't get my NPC's to execute a command, i manly use this for Bossshop..
-
View User Profile
-
Send Message
Posted Apr 29, 2017In reply to Forge_User_53417291:
-
View User Profile
-
Send Message
Posted May 1, 2017In reply to razorrider7:
-
View User Profile
-
Send Message
Posted Apr 25, 2017I cant for the life of me get an NPC to teleport a player to another server
I have tried just about every combination
/npc addcmd -c server creative
/npc addcmd -c creative
Nothing works
-
View User Profile
-
Send Message
Posted Apr 26, 2017In reply to Ubique1964:
-
View User Profile
-
Send Message
Posted Apr 24, 2017It's fine with Citizens ?
-
View User Profile
-
Send Message
Posted Apr 24, 2017In reply to creepersifu:
-
View User Profile
-
Send Message
Posted Apr 23, 2017I have a Problem with the permissions i think ...
Me (as an OP) can interact and trigger the Commands i gave to an NPC but everybody who is not OP can't ...
Do my players need a specific permission for this? (I havent set up any permission in the -p flag, so i thought everybody can use it)
-
View User Profile
-
Send Message
Posted Apr 24, 2017In reply to Illevyard:
-
View User Profile
-
Send Message
Posted Apr 24, 2017Okay thanks, i'll test it out
-
View User Profile
-
Send Message
Posted Apr 25, 2017In reply to razorrider7:
-
View User Profile
-
Send Message
Posted Apr 25, 2017In reply to Illevyard: