-
Notifications
You must be signed in to change notification settings - Fork 34
Creating a Custom Command (using Tags)
This short tutorial will walk you through creating your very own "custom command" for your server. In case you were curious, the commands like 8ball
and rate
and choose
aren't actually commands at all, they're tags! However, they have been "imported" to act like commands by default. Here's how to set it up:
I want to make a command called "weather" and I want it to show me a random weather symbol, and a random "percent chance" of that weather happening.
Making a random choice between multiple things is easy! Just use a {choose:}
statement in the tag. Since we want to pick a random weather emoji, our choose statement might look like this: {choose:β|π€|β
|π₯|π¦|β π§|β|π©|π¨}
. Next, we want a random percent, so let's get a value between 0 and 100 with a {range:}
statement, like {range:0|100}
. Now, we can build our tag. %tag create weather {choose:β|π€|β
|π₯|π¦|β π§|β|π©|π¨} ~ {range:0|100}%
. Feel free to test out the tag, and double check the tag's raw content if necessary. (For full documentation on what you can use in tags, see JagTag)
On your server, simply type %tag import <tagname>
(so, for our example, %tag import weather
). Importing adds the tag as a "tag command" for the server. You can now use the tag as if it is a regular command! If you ever want to unimport the tag, simply %tag unimport <tagname>
(for full tag commands, please see %tag help
)