Skip to content

Aliases

Sven Rahn edited this page Jul 22, 2017 · 14 revisions

Aliases

Example config:

alias {
    aliases {
        "give me {0} {1}" {
            commands=[
                "*give $p {1} {0}",
                "*say $p got {0} {1}!"
            ]
            permission=give-me
        }
    }
}

When executing /give me 30 minecraft:cookie you get 30 cookies. $p resolves to the player's name if a player is executing the command.

Another example: Shouting in the chat

"shout {...}" {
    commands=[
        "*tellraw @a [\"\",{\"text\":\"<$p> \"},{\"text\":\"{...}\",\"bold\":true}]"
    ]
    permission=shout
}

{...} is a vararg. 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.

Clone this wiki locally