Commands & Permissions - HexedHero/CitizensCMD GitHub Wiki

Commands

Command Permission Alias Description Syntax
/npcmd citizenscmd.help help Displays the help. /npcmd
/npcmd add citizenscmd.add add Adds a new command to the NPC. /npcmd add <console|message|none|permission|server|sound> <command> [-n] [-l] [-d ]
/npcmd cooldown citizenscmd.cooldown cd Sets the cooldown for the NPC. /npcmd cooldown
/npcmd price citizenscmd.price p Sets the price for the NPC. /npcmd price
/npcmd list citizenscmd.list l Gets the list of commands. /npcmd list
/npcmd edit citizenscmd.edit edit Edits a command or permission. /npcmd edit <cmd|perm> <left|right> <id> <new cmd|new perm>
/npcmd remove citizenscmd.remove delete, del, rem Removes command. /npcmd remove <left|right> <id>
/npcmd reload citizenscmd.reload reload Reloads all files. /npcmd reload

<> - Required, sometimes either one of the options. Example: <left|right> either left or right should be used.
[] - Optional, will work without it.
There is two new permissions:
citizenscmd.bypass - Players with this permission will bypass the NPC cooldowns.
citizenscmd.use - Negate this permission if you don't want a player to use an NPC.


Help

Use this to display ingame help. Either /npcmd or /npcmd help.

Add

/npcmd add <console | none | permission | server> <command> [-l]
This is the main command to add commands to an NPC.

console The command will be executed from the console
message Will display a message when you click the NPC
none No permission will be checked, it'll be just the player's basic permission
permission A custom permission node, for example essentials.heal it'll execute the command with this permission.
server Use this to change servers.
sound Use this to add sounds to the NPC.

<command> Is the command you want to execute.
[-l] Is if you want that command to be a left click instead of right click.
[-n] Is if you want to display the NPC name when sending a message.

Examples:
Console:
/npcmd add console heal %p% - This will be executed by the console and heal the player who clicked.
The console will run /heal LichtHund where LichtHund is the player's name.

Message:
/npcmd add message Hello -n - This will the message look like NPC-Name: Hello.
/npcmd add message Hello - This will the message look like Hello.

None:
/npcmd add none heal - This will be just like the player typing /heal, so if the player does not have the permission to heal it'll simply display the no permissions message.

Permission:
/npcmd add essentials.heal heal - This will be run by the player like heal but this time it'll add the permission essentials.heal to the player execute the command and remove the permission.

Server:
/npcmd add server survival - This will send the player who clicked to the server survival.

Sound:
/npcmd add sound BLOCK_ANVIL_PLACE 1 1 - This will play the sound BLOCK_ANVIL_PLACE at 1 volume and 1 pitch.

Placeholders:
The two main placeholders that you can use is %p% or %player% both will be the player clicking on the NPC.
CitizensCMD also fully supports PlaceholderAPI's placeholders.

Cooldown

/npcmd cooldown <time> This command is used to set the cooldown to the NPC, the default value can be set in the config.yml.
The cooldown must be a number in seconds.

One time use:
To make the cooldown be a one time use simply set the cooldown to -1.

Example:
/npcmd cooldown 15 - Will make the cooldown be 15 seconds.

Price

/npcmd price <price>
This command is used to set the price to use the NPC, the default is 0.
When an NPC has a price it'll ask the player to confirm the click, so the player don't spend unwanted money.

To use price vault is required

Example:
/npcmd price 100 - Every click will cost 100$.

The confirmation will either need shift click or not, this can be changed in the config.yml.

List

/npcmd list
This command display the list of commands, the cooldown and the price set to an NPC.

Example:
/npcmd list

Edit

/npcmd edit <cmd | perm> <left | right> <id> <new cmd | new perm>
This command allows you to edit the NPC data without needing to go to the file.

First argument:

cmd Use this to edit the command.
perm Use this to edit the perm

Second argument:

left Use this to edit the command or permission from the left click command.
right Use this to edit the command or permission from the right click command.

Third argument:
<id> - The ID is the identifier of the command when you do /npcmd list for example, on the list above the command [console] say hello has the ID 1.

fourth argument:
<new cmd | new perm> - This is simply the new command or permission you want to set.

Examples:
Let's edit the command [console] say heyllo. /npcmd edit cmd right 1 heal - The command now will look like [console] heal.
Now let's edit the permission.
/npcmd edit perm right 1 essentials.heal - The command now will look like [essentials.heal] heal.

Remove

/npcmd remove <left | right> <id>
This command will remove a specific command from the NPC without needing to edit the file.

First argument:

left Use this to remove the left click command.
right Use this to remove the right click command.

Second argument:
<id> - The ID is the identifier of the command when you do /npcmd list for example, on the list above the command [console] say hello has the ID 1.

Example:
/npcmd remove 1 - This would remove the command [console] say hello from above.

⚠️ **GitHub.com Fallback** ⚠️