Skip to main content
 Warning: Beta Version
Version: Beta ⚠️
Difficulty: Hard

Custom Commands

 Before starting

This guide assumes that you have already installed the Basic Extension.

 Custom Commands

This guide show you how to create a custom command with argument, if you don't need arguments, you can use the RunCommandEvent to create a command without arguments.

In this tutorial, you will learn about custom commands and how to create one. We will create a command where you can define a pseudo and an age to display a message to the player.

Creating a Custom Command

In this tutorial, we will create a command where you can define a pseudo and an age to display a message to the player. We will use a Custom Command Entry to start defining our command. To add a custom command entry, go to the top right corner of the panel and click on the + icon. Search for Add Custom Command, add it to your manifest and name it.

Add Custom Command
Create custom commands with parameters
+

Creating the arguments

Now, we will need two types of arguments; a Word Argument to get a word, in this case, the pseudo, and a Number Argument to get a number, in this case, the age. To add an argument, click on the Custom Command entry, then on Arguments, and select Add Word Argument. Next, click on the last argument and add a child: Add Number Argument.

Custom Command Arguments
Arguments Children
 Number Argument

Rename your arguments to make it easier for players to understand it when they will execute the command.

Do something with your command

If you want your command to actually do something when you run it you can do the following steps:

  1. In the Number Argument, add a trigger. For this guide we will use a Send Message entry.
  2. Inside the Send Message entry click on the icon above the message field and search for String Builder Variable.
  3. Now create a part in the string builder and call it pseudo.
  4. For the value of this part use a Interaction Context String Variable and set the entry to the earlier created Pseudo Word Argument entry.
  5. Do the same for the number argument
  6. Lastly construct a message. For this guide we used Hi <pseudo>, you are <age> years old.
Interaction Context Text Variable

Result

Sequence result

Now your pages should look something like this:

Interactive Graph

This is an interactive graph of all the entries in the selected pages.
You can view different pages by clicking on the tabs. Each page contains a view of the entries in that page.
Click on an entry to view its details.

 Variables

Our documentation renderer doesn't currently support displaying dynamic variables, so you'll only see a simplified static message instead of the actual variable.

In Game result

In game, the command should look like this: