Argument Placeholders
If you have an alias which isn't so straight forward, like /lp user Potato parent set GroupName, and you want to shorten it, you may have some issues. But in 1.6, not anymore
You can use the placeholders {0} , {1}, ... {100000} etc.
(/{0} {1} ...) in your command aliases to manipulate the order which placeholders are filled in.
For example,
Code (YAML):
'lp user {1} parent set {2}':
aliases
:
- setgroup
enabled
: true
Will allow for /setgroup xEline Cheescake. Unused arguments will be trailed on the end UNLESS, you put a placeholder in which cannot be reached in the context of how many arguments provided. Like if you do "verycomplex {6} command {1} {2}" for /complex. If you only do '/complex'
'verycomplex' will be run alone. Likewise with '/complex arg1 arg2 arg3 arg4', only 'verycomplex' will be run and there will be no trailing arguments. (like arg1 -> 3)
Running several commands from one alias
If you want to run several commands from one command, you can do so.
Set "keep-iterating-when-match" to "true" in advanced.
In your config have a section like:
Code (YAML):
god:
aliases
:
- buff
enabled
: true
fly:
aliases
:
- buff
enabled
: true
flyspeed 5:
aliases
:
- buff
enabled
: true
As you can see, for every single command it loops back to the same alias so that it will execute all of these.
Run Conditions
There are several run conditions which can be appended to each alias section and look like this:
Code (Text):
-msg-heal:
...
conditions:
# With "0", it will only show if no args (doesn't include label)
args: 0
As of 1.5, there are 4 default run conditions you can use:
- args -> the args input in the alias
- world -> the world the player is in (can also be a list of worlds)
- gamemode -> the player's gamemode
- health -> the player's health
Just add them into a "conditions" section under any alias you have. Multiple can be used for one alias.
Letting a command run if the player doesn't have the alias permission
This will mean that if a user does NOT have the permission to run said alias, it will ignore the event and let other plugins handle it.
This can be used in joint with alias run conditions (as of 1.4.2 there is only one, "args")
Code (Text):
-msg-heal:
aliases:
- '&dHeal who?'
enabled: true
# Conditions as of 1.4.2
# "args" -> integer (args in command)
conditions:
# With "0", it will only show if no args (doesn't include label)
args: 0
Here is an example which will only run this alias when there are 0 args, i.e "/heal" ONLY.
Hope this helps accomidate to advanced users, as all these features were requested by the great community
I will try and accommodate to most of them but remember this is a public plugin and being lightweight and easy to use is one of the core values.