Skip to content

Creating a Custom Command (using Tags)

John Grosh edited this page Dec 10, 2016 · 1 revision

Intro

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:

Goal

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.

Step 1: Make a tag

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)

example

Step 2: Import the tag

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)

example

Clone this wiki locally