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 17, 2014Someone who has bungeecord on their server be so kind and test the npc's with CommandNPC. I implemented a new way of executing the commands and would like to see if it works this way.
-
View User Profile
-
Send Message
Posted Jul 17, 2014@hellobgbg
Yes, just keep using the addcmd command and it will execute all of them at once
-
View User Profile
-
Send Message
Posted Jul 17, 2014@messageofdeath can we put multiple commands in 1 npc?
-
View User Profile
-
Send Message
Posted Jul 16, 2014Be the first to get v1.5 with some bug fixes as well as a fix for using commands from alias plugins http://dev.bukkit.org/bukkit-plugins/cmdnpc/files/8-command-npc-v1-5/
-
View User Profile
-
Send Message
Posted Jul 16, 2014@MrQuibe
@Victhetiger
@noseynose03
I just thought of a way to do it! For all player commands I will change the way they are executed. Instead of using the Bukkit API I will make the player send a message normally and it should add support for that. Meaning the same thing when you try to talk to someone.
@JackzMc
In this next version I will add the functionality in the config whether you want left/right/both click.
v1.5 is released! Be the first to check it out! http://dev.bukkit.org/bukkit-plugins/cmdnpc/files/8-command-npc-v1-5/
-
View User Profile
-
Send Message
Posted Jul 14, 2014Adding command fake!
Examples:
-
View User Profile
-
Send Message
Posted Jul 12, 2014With the new version, I can only punch it. I want to be to do both, or even better, when adding the command, make it only with right or left click or both.
-
View User Profile
-
Send Message
Posted Jul 11, 2014@messageofdeath
Actually, i could explain it to you on my server - tigermc.net You will see
-
View User Profile
-
Send Message
Posted Jul 11, 2014@messageofdeath
I know! xD I Didn't Put it xD I Select it and /npc addcmd false noPerm buy
Still no work :/
-
View User Profile
-
Send Message
Posted Jul 11, 2014@Victhetiger
dont put the '/' in front of the command
-
View User Profile
-
Send Message
Posted Jul 11, 2014Does This Plugin Work With ChestCommand? Its like a Chest Menu, I'd Love To Use It With T Plugin, But I don't think it works..
-
View User Profile
-
Send Message
Posted Jul 11, 2014@messageofdeath
I Always Put False, it's Just Weird :/ It Says "Unknow Command..."
Maybe it Has To Be The Player and Only the Player :/
-
View User Profile
-
Send Message
Posted Jul 10, 2014@Victhetiger
Make sure you set the <inConsole(true/false)> to FALSE. To make sure that command gets runned by the player instead of the console
-
View User Profile
-
Send Message
Posted Jul 10, 2014Ok, i am using EnjinMinecraftPlugin or Something like that and /buy on a NPC Doesn't Work
What Could be Doing that?
-
View User Profile
-
Send Message
Posted Jul 9, 2014@Rocketboy901
Thank you
-
View User Profile
-
Send Message
Posted Jul 9, 2014@YellowKamel
I will add that soon! Thanks for your feedback!
-
View User Profile
-
Send Message
Posted Jul 9, 2014Can you please add an option in the config, so that it only work if you right click?
-
View User Profile
-
Send Message
Posted Jul 9, 2014@MrQuibe ~Translation~
Adding command fake!
-
View User Profile
-
Send Message
Posted Jul 8, 2014Can I add multiple commands?
-
View User Profile
-
Send Message
Posted Jul 8, 2014Adicione comando falsos!