Commands
Create custom commands
Last updated
Create custom commands
Last updated
These commands cannot be executed by console, or by command blocks. You need an entity (typically a player) to execute these custom commands.
MechanicsEverywhere lets you create custom commands which trigger . This allows you to create instruction commands, visual effects, and other fun admin tools. This can also be used to give donator perks. To add a command, go into this folder:
your server -> plugins -> MechanicsEverywhere -> commands
And create a new .yml
file. Then, you can use these options:
The label is the unique name for your command, and how you will spell it in Minecraft. So if you use tpa
for the label, you will use /tpa
in-game.
A generalized description of what the command does. This is optional, but you should use it if you want to use the Help feature.
A custom permission which is required to run the command. If you use a permission that already exists (for example, essentials.fly
from EssentialsX), make sure you do not use the Description
and Default
options, since they will override the values.
Name
-> The name of the permission, like mechanicseverywhere.myawesomecommand
Description
-> A short description of what the permission does (For permission managers).
Default
-> Who has this permission by default (see below)? Defaults to OP
.
All players have permission by default.
A list of "alternative shorthand names" for your command. For example:
The "meat" of the command, or what actually happens. You can use mechanics to:
Run other commands
Play sounds/spawn particles/play effects
Apply potions/damage/movement
@Source{}
-> The entity who executed the command.
@Target{}
-> Depends on Allow_Targeter, but none by default.
Allow_Targeter
may not be used with Subcommands
Consider the custom command /murder
, which kills any targeted entity. When you use it in game, you may want to target only zombies, so you run something like:
/murder @e[type=minecraft:zombie]
In this case, you would want to target multiple entities:
No targeter is allowed.
Subcommands
may not be used with Mechanics
, or Allow_Targerter
.
Consider the vanilla command /effect
(Which gives potion effects). The /effect
command has 2 subcommands:
give
-> Gives potion effects.
clear
-> Clears potion effects.
Now let's create a command /nv
, which turns on night vision. We can run /nv on
to turn it in, or /nv off
to turn it off. Let's see how we can do that with subcommands:
Subcommands have all the same options as normal commands, except you can only use Help
on the root command. Subcommands cannot use Help
.
When you use this option, a "help menu" will be automatically generated for your command, which can be accessed by adding help
or ?
after the command.
Color
-> The main color, used for "identifying" information.
Accent
-> The accent color, used for longer names/descriptions.
Symbol
-> The symbol used for lists, defaults to ➢
.
WeaponMechanics uses <gold>
for the main color, and <gray>
for the accent color. Since we use MiniMessage to parse colors, you can use hex and styles:
Use the wiki, and look at the examples below.