MyCommand Plugin
Last modified on Jan 3, 2023 in Plugins
By Nathan Young
Overview
Minecraft server owners may be interested in adding plugins to implement new commands and features. In some cases, the desired outcome from those plugins aren’t what you want, thereby leading you to customize new commands from scratch. The good news is MyCommand, or otherwise known as MyCMD, can achieve that because it’s an all-in-one tool that allows you to create custom commands or functions. For example, designing commands for shops, broadcasts, information, aliases, and other functions are some things that server owners may want. However, the processes for configuring them can be challenging due to the complexity of the plugin. The more complex a function is, the more likely you could have an error in the file’s configuration. Luckily, we created this detailed Apex Hosting guide to showcase the popular uses for MyCommand and the process for setting this up on your server.
Server Installation
- Click
Download
in the top right from MyCommand’s Spigot page. - Head over to the Apex server panel and on the left-hand side, click
FTP File Access
then login using your password. - Locate and enter into the
plugins
folder, then pressUpload
in the top left. - Drag and drop the MyCommand plugin JAR file into the “Drop files here to upload” section.
- Wait for the upload to reach
100%
andRestart
the server afterward.
For more information about manually uploading plugins, go here.
How to use MyCommand
The plugin itself is a bit complicated at first, but breaking it down piece by piece will help you understand it more. You’ll be learning the specific command types, variables to use, and options to implement for each of them. Most of the configuration is spent in the files of the plugin, so in-game commands aren’t truly needed. However, there are tons of commands to use with this plugin, which you can find here.
Command Settings
Learning the specific settings for making commands are important, especially when unique formatting is required to make it properly work. Down below are the most common settings for you to start using with MyCommand.
Types
TEXT
– The creation of text-only commands.
RAW_TEXT
– The usage of text commands and variable functions.
RUN_COMMAND
– Only used for running other commands and variables.
ALIAS
– Executing other commands without variables, only defined commands from the server.
For a total list of all possible command types, visit MyCMD’s Type wiki.
Variables
$arg1, $arg2, $arg3, etc.
– Arguments for defined commands such as the player’s name, item amount, location, and so on.
$multiargs
– An unspecified number of arguments for a command or function, mainly used for typing a personalized message in-game.
$player
– Returns the command sender’s username.
$world
– Shows the command sender’s world name.
$online
– Displays the number of online players connected to the server.
$money
– Gives the total amount of currency the sender has in-game (requires Vault).
You may find a complete list of variables on MyCMD’s Variable wiki.
Options
registered: true/false
– Toggles if the command or function is registered in the auto tab completion.
permission-required: true/false
– Determines if the command or function requires permission to use in-game.
permission-node: example.perm
– If permissions are enabled, then this defines the node to use the command in-game.
permission-error: 'Enter error message'
– If permissions are enabled, but the user lacks them then this defines the error message appearing in-game.
Format
MyCommand has a lot of specific formats tailored to what command or function you want to use. Down below is an example of the basics for you to get started, but for more detailed examples go here.
Configuring the File
Before making custom commands or functions, you’ll want to create a new YML file to store all of them. You may create as many as you want to better organize your settings, which will also be implemented in-game.
- From the panel, navigate to the
FTP File Access
button on the left-hand side and login. - Locate and enter into the
plugins
folder, then press onMyCommand
. - Once there, click
commands
and selectNew file
in the top left. - Give the file a name that corresponds to your command category and end it with
.yml
.
For example:alias.yml
- After that, proceed to enter your custom commands and press
Save
, thenRestart
the server.
You can always come back to the file for adding or changing commands. If you make changes to it, then use the following command in-game to reload MyCommand in your server.
/mycmd-reload commands all
Note: Inside of the main commands
folder, you will see a file called examples.yml
. You can press Edit
to the right of it to review predefined commands. It’s safe to delete that file, but any command in it can be used by players if kept. You can also review examples on the MyCMD official wiki here.
Popular MyCommand Examples
As noted previously, the plugin has a lot of functionality and features to use, which can take time to understand due to the complexity of it. Because of that, we’ll go through popular usages from MyCMD to help you see properly configured commands and functions. Keep in mind that you can use this plugin for almost any function or ability you want in the server, so don’t be limited by our examples.
Creating a Shortcut Command
You can use any command from any plugin to make a shorter command for them through an alias. For example, if we use EssentialsX’s warp system for a PvP arena, then we can create a faster way to teleport there.
pvp:
command: /pvp
type: ALIAS
alias: /warp pvp
registered: true
permission-required: false
Similar to an alias, this type of command is used for creating a “shortcut” to perform a function with an input variable. For example, using LuckPerms to set a VIP rank for a player is a long command so using this method allows for a quicker way to run it.
vip:
command: /vip
type: RUN_COMMAND
runcmd:
- '/lp user $arg1 parent set vip'
registered: true
permission-required: true
permission-node: server.vip
permission-error: "You don't have permission to use that!"
Note: The $arg1
variable will be the player’s name for this type of command because the /lp user
command requires that by default with LuckPerms. The same logic will apply to any command you wish to create a shortcut.
Players with the server.vip
permission node can execute this command. You may change that to anything you want and it should work. You can also set the permission-required
setting to false
if you didn’t want that enabled.
Creating a Rules Command
Every line will display in-game as text and you can even add color codes for better formatting.
rules:
command: /rules
type: TEXT
text:
- '-----------------------------------------'
- 'Rule 1: Be nice!'
- 'Rule 2: Add another rule.'
- 'You can add more lines and format it how you want.'
- '-----------------------------------------'
registered: true
permission-required: false
Other examples with this setup may include a help or info command.
Creating a Voting List
Click on the line where you used a link, which should be the ones that have hoverable text and that will open up to the URL you defined.
vote:
command: /vote
type: RAW_TEXT
text:
- '-----------------------------------------'
- '$OPEN_URL$Link 1: Displayed text;This text displays when hovered;Add the URL here'
- '$OPEN_URL$Link 2: More displayed text;Hover text;Add another URL here'
- '-----------------------------------------'
registered: true
permission-required: false
Each line for the voting site requires $OPEN_URL$
before the displayed text, then separated with a semi-colon for the hover and actual URL. However, you can also use normal text for lines without any voting link.
Creating a Custom Trade
You can make custom villager-like trades that players can use as a shop. MyCommand allows you to set a max usage for a specific trade and grants you the ability to use any in-game item for trading.
shop:
command: /shop
type: MERCHANT
merchant_title: 'Enter Your Shop Name'
merchant_items:
- GOLDEN_APPLE:3(cost)DIAMOND:3
- TOTEM_OF_UNDYING:1(cost)DIAMOND:16(max_uses)1
registered: true
permission-required: false
The format for merchant_items
lines is:
item:amount(cost)item:amount(max_uses)number
Essentially, the first item name and amount is the offer to the player. After the (cost)
value, the item and amount is what the player has to trade. Use this format to add more lines in the configuration file to get more trades.
Conclusion
The MyCommand plugin is a large tool for making custom commands that have a wide range of functionality. You can implement shortcut commands, custom trades, broadcast messages, custom rules, and so much more. The configuration of setting them up takes time to understand, but our popular examples showed you how to properly use the plugin to make that process easier. As a reminder, our examples cover the basics and you are not limited to only use them. MyCMD has a lot of customization options for you to use, and our config editor in the FTP panel makes it smoother for you to start using the plugin. Now that you know the fundamentals of the plugin, you can start creating custom commands on your Minecraft server!
Common Issues
Registered Commands Not Working
If you configured the registered
option for your command to true
, but it still doesn’t work then restart the server from the panel. Most of the time that will work, but if that fails then try running the /mycmd-reload commands (file name)
command in-game. Replace “(file name)” with the exact name you labeled the file containing all your custom functions.
Custom Command Not Working
If you set up a command in your file and that does not work, then double-check you have a valid type
and correct format of the function. For instance, every command must have a name for it, then below that a few spaces and the according setting and option. If there aren’t any spaces like in our examples, then it won’t work. Additionally, if the name of the function or actual command input matches another one then that won’t work either. In rare cases, MyCommand doesn’t override existing commands from plugins due to design choices by the plugin authors.
Useful Links
MyCommand Examples
MyCommand Types
MyCommand Variables
MyCommand Permissions