- Notifications
You must be signed in to change notification settings - Fork 1
Aliases
Sven Rahn edited this page Jun 7, 2021 · 14 revisions
The config is located at config/command-utils/aliases.conf
.
Example config:
aliases { "give me {0} {1}" { commands=[ "*give %player% {1} {0}", "*say %player% got {0} {1}!" ] permission="give-me" } }
When executing /give me 30 minecraft:cookie
you get 30 cookies. You need the permission give-me
to do that.
Features learned:
- You can use placeholders in aliases, such as
%player%
resolving to the player's name when executed by a player -
*
makes the command run as the console and therefore has all permissions, without*
the command would be executed as the command source that executes the alias
Another example: Shouting in the chat
"shout {...}" { commands=[ """*tellraw @a ["",{"text":"<%player%> "},{"text":"{...}","bold":true}]""" ] permission=shout }
Features learned:
-
{...}
is avararg
. It can only be used once in an alias, and if it is used then only at the end. It captures everything from its position until the end.
If you have PlaceholderAPI installed, you can used every placeholder in commands.
aliases { "give me {0} {1}" { commands=[ "*give %player% {1} {0}", "*say %player% got {0} {1}!" ] permission="give-me" cooldown="1h" } }
Easy as that. Specify cooldowns as explained here.