Custom commands
Create your own commands from the web editor, each one running a list of actions such as messages, menus, teleports, sounds and money.
The Custom commands module lets you create your own commands without any other plugin: /discord to share your Discord link, /rules to show the rules, /event to teleport players to an event, a paid /heal and so on. Each command runs a list of actions, in order, and gets the same settings as every other InglisCore command: aliases, permission, cooldown, price, worlds and rank rules.
Features
- Unlimited commands, created and edited from the web editor. Changes apply right away, no restart needed.
- Ten kinds of actions: send a message, run a command as the player or as the console, open a menu, teleport, play a sound, give or take money, wait, and announce to the whole server.
- Arguments: use what the player typed after the command in messages and commands.
- Translated messages that follow the language of each player.
- Rank rules like any other InglisCore command: who may use it, cooldown and price, rank by rank.
- Ready made examples:
/discord,/rulesand/storeare included, turned off. Turn them on and adapt them.
Setting it up
Open the Custom commands module in the web editor. The Commands tab lists your commands. Click New command to create one, then fill in:
| Field | What it does |
|---|---|
| Command | Name of the command, typed after the /. Lowercase letters, digits and _ only. |
| Description | Short description of the command. |
| Usage shown when arguments are missing | Message shown when the player types fewer arguments than required, for example /report <player> <reason>. |
| Minimum arguments | Number of words the player must type after the command (0 to 20). |
| Actions | What the command does, in order (up to 30 actions). |
Each command also has the usual command settings: name and aliases, permission, worlds where it is disabled and, rank by rank, access, cooldown and price. See commands. By default a new command is allowed for everyone and its permission is inglis.customcommands.<name>.
Delete this command removes it.
Actions
| Action | Value | Example |
|---|---|---|
| Send a message | Text sent to the player. Color codes are allowed. | &aHello {player}! |
| Player command | Command run as if the player typed it, so their own permissions and restrictions apply. | spawn |
| Console command | Command run by the console. | give {player} diamond 1 |
| Open a menu | ID of a menu made with the menus module. | main |
| Teleport | warp: followed by a warp name, or a world and coordinates, optionally followed by yaw and pitch. |
warp:spawn or world 0 64 0 |
| Play a sound | Minecraft sound name, optionally followed by a volume (0 to 10) and a pitch (0.5 to 2). | entity.player.levelup |
| Give money | Amount, optionally followed by a currency ID. Without a currency, the main currency is used. | 100 or 100 gems |
| Take money (stops if not enough) | Same format. If the player cannot pay, they are told so and the next actions do not run. | 100 |
| Wait (ticks) | Pause before the next action, in ticks (20 ticks = 1 second, 1200 at most). | 20 |
| Announce to the server | Message sent to every online player. | &e{player} &7joined the event! |
Teleport needs the teleport module for warps. Give money and Take money need the economy module.
Variables
| Variable | Replaced by |
|---|---|
{player} |
Name of the player who used the command. |
{arg1}, {arg2} and so on |
First, second and following words typed after the command. Empty when missing. |
{args} |
Everything typed after the command. |
{lang:key} |
A text of the Messages page, in the language of the player who reads it, for example {lang:customcommands.examples.discord}. Messages and announcements only. See languages. |
PlaceholderAPI placeholders such as %player_world% also work in messages and commands.
For safety, words typed by the player are cleaned before they go into a command: only letters, digits and a few punctuation marks are kept. Color codes typed by players are removed from messages.
Commands
Each custom command you create becomes a real command. Its aliases, permission, cooldown, price, worlds and rank rules can be changed in the editor, see commands.
| Command | What it does | Default permission |
|---|---|---|
/<name> |
Runs the actions of your command. Players only. | inglis.customcommands.<name> |
/discord |
Example: shows your Discord link. Off by default. | inglis.customcommands.discord |
/rules |
Example: shows the server rules. Off by default. | inglis.customcommands.rules |
/store |
Example: shows the link to your store. Off by default. | inglis.customcommands.store |
Tips
- To charge for a command, you can either set a price in its command settings (paid before the actions run, with a cooldown if you want) or put a Take money action at the start: the actions after it only run if the player can pay.
- Use Wait between messages to make a short story or countdown, for example a message, a 2 second wait (
40), then a teleport. - The example commands use
{lang:key}: change their text for each language in the Messages page rather than in the action.