Skip to content

Configuration

The Custom Commands plugin uses two main configuration files: config.yml for command definitions and messages.yml for all plugin messages. This guide will help you understand and customize these files.

plugins/CustomCommands/
├── config.yml # Command definitions and settings
├── messages.yml # All plugin messages and prefix
└── logs/ # Log files (auto-generated)

The main configuration file where you define your custom commands and plugin settings.

debug:
enabled: true # Enable/disable debug mode
console: true # Show debug messages in console
file: true # Write debug messages to log files

Debug Mode:

  • enabled: true - Enables detailed logging for troubleshooting
  • console: true - Shows debug messages in server console
  • file: true - Writes debug messages to log files

Each custom command is defined in the commands section:

commands:
commandname:
permission: "customcommands.commandname" # Required permission
alias: ["alias1", "alias2"] # Alternative command names
description: "Command description" # Help description
enabled: true # Enable/disable command
cooldown: 5 # Cooldown in seconds (0 = no cooldown)
message: # Messages to send (optional)
- "&6&l=== Title ==="
- "&7Your message here"
commands: # Commands to execute (use "commands" instead of "console_commands")
- "say {player} used the command!"
subcommands: # Subcommands (optional)
subcommand1:
permission: "customcommands.commandname.subcommand1"
message: # Optional - can be omitted
- "&eSubcommand message"
  • permission - Required permission to use the command
  • alias - Alternative command names (players can use these instead)
  • description - Description shown in /help command
  • enabled - Enable or disable the command (true/false)
  • cooldown - Cooldown in seconds (0 = no cooldown)
  • message - List of messages sent when command is used (optional - can be omitted)
  • commands - Commands executed when command is used (use type to control execution type)
  • subcommands - Subcommands for tab completion (optional)
discord:
permission: "customcommands.discord"
alias: ["dc"]
description: "Join our Discord"
enabled: true
cooldown: 0
message: # Optional - can be omitted if you only want commands
- "&6&l=== Discord ==="
- "&eJoin our Discord server!"
- "&7Click here: (Discord)[<https://discord.gg/2qCMn6KHj4>]"
- "&7For support and updates"
silent:
permission: "customcommands.silent"
commands: # No message field - command executes silently
- "effect give {player} minecraft:invisibility 30 1 true"
website:
permission: "customcommands.website"
alias: ["web", "site"]
description: "Visit our website"
enabled: true
cooldown: 5
message:
- "&a&lWebsite"
- "&7Visit our website: (Click here)[<https://example.com>]"
rules:
permission: "customcommands.rules"
alias: ["rule"]
description: "Show server rules"
enabled: true
cooldown: 10
message:
- "&c&lServer Rules"
- "&71. Be respectful to other players"
- "&72. No griefing or stealing"
- "&73. No cheating or hacking"
- "&74. Follow staff instructions"
- "&75. Have fun!"

Subcommands allow you to create complex command structures with tab completion:

discord:
# ... main command properties ...
subcommands:
send:
permission: "customcommands.discord.send"
message:
- "&eSending Discord invite to your DMs!"
commands:
- "msg {player} &6Discord Server: &bhttps://discord.gg/2qCMn6KHj4"
invite:
permission: "customcommands.discord.invite"
message:
- "&eHere's your Discord invite:"
- "&7(Join Discord)[<https://discord.gg/2qCMn6KHj4>]"
help:
permission: "customcommands.discord.help"
message:
- "&6Available subcommands:"
- "&7/discord send - Send invite to DMs"
- "&7/discord invite - Show invite link"
- "&7/discord help - Show this help"

:::tip Advanced Subcommands For nested subcommands (subcommands within subcommands), argument validation, player-specific arguments, and command execution types, see our Advanced Features Guide. :::

Execute server commands when players use your custom commands:

example:
# ... other properties ...
type: "Console" # Command execution type (Console or Player)
commands: # Note: Use "commands" instead of "console_commands"
- "say {player} used the example command!"
- "effect give {player} minecraft:glowing 10 1 true"
- "title {player} title [\"\",{\"text\":\"Welcome!\",\"color\":\"gold\"}]"
- "tellraw @a [\"\",{\"text\":\"Player \",\"color\":\"yellow\"},{\"text\":\"{player}\",\"color\":\"green\"},{\"text\":\" is at \",\"color\":\"yellow\"},{\"text\":\"{x}, {y}, {z}\",\"color\":\"aqua\"}]"

:::info Command Execution Types You can control whether commands are executed as the server console (default) or as the player using the type field. See Advanced Features Guide for details. :::

  • {player} - Player name
  • {displayname} - Player display name (with colors)
  • {world} - Player’s world name
  • {x} - Player’s X coordinate
  • {y} - Player’s Y coordinate
  • {z} - Player’s Z coordinate
  • {online_players} - Number of online players
  • {max_players} - Maximum players
  • {args} - All command arguments as a single string (see Advanced Features)
  • {arg:1} - First argument (1-based index)
  • {arg:2} - Second argument (empty string if not provided)
  • {arg:N} - Nth argument (empty string if not provided)

The messages configuration file contains all plugin messages and the prefix.

prefix: "&#00FFAA[CustomCommands] "

The prefix is automatically replaced in all messages that contain {prefix}.

welcome: "`{prefix}`&aWelcome to the Custom Commands plugin!"
plugin_enabled: "`{prefix}`&aPlugin has been enabled successfully!"
plugin_disabled: "`{prefix}`&cPlugin has been disabled!"
reload_start: "`{prefix}`&eReloading configuration files..."
reload_success: "`{prefix}`&aConfiguration files reloaded successfully!"
reload_error: "`{prefix}`&cFailed to reload configuration files! Check console for details."
reload_no_permission: "`{prefix}`&cYou don't have permission to reload the plugin!"
command_not_found: "`{prefix}`&cCommand not found: {command}"
command_no_permission: "`{prefix}`&cYou don't have permission to use this command!"
custom_command_executed: "`{prefix}`&aCustom command '{command}' executed by {player}!"
custom_command_cooldown: "`{prefix}`&cYou must wait {time} seconds before using this command again!"
custom_command_disabled: "`{prefix}`&cThis command is currently disabled!"
info_version: "`{prefix}`&eCustom Commands v{version}"
info_author: "`{prefix}`&eAuthor: {author}"
info_help: "`{prefix}`&eUse /customcommands help for available commands"
support_info: "`{prefix}`&6=== Support Information ==="
support_discord: "&eDiscord Server: &bhttps://discord.gg/2qCMn6KHj4"
support_help: "&7Join our Discord for support and updates!"
support_footer: "`{prefix}`&6=============================="
help_header: "`{prefix}`&6=== Custom Commands Help ==="
help_reload: "&e/customcommands reload &7- Reload configuration files"
help_help: "&e/customcommands help &7- Show this help message"
help_version: "&e/customcommands version &7- Show plugin version"
help_support: "&e/customcommands support &7- Show support information"
help_footer: "`{prefix}`&6=============================="
&0 = Black &8 = Dark Gray
&1 = Dark Blue &9 = Blue
&2 = Dark Green &a = Green
&3 = Dark Aqua &b = Aqua
&4 = Dark Red &c = Red
&5 = Dark Purple &d = Light Purple
&6 = Gold &e = Yellow
&7 = Gray &f = White
&l = Bold
&n = Underline
&o = Italic
&k = Magic (random characters)
&m = Strikethrough
&r = Reset (removes all formatting)
&#FF8800 = Orange
&#00FFAA = Cyan
&#FF0000 = Red
&#00FF00 = Green
&#0000FF = Blue
(Display Text)[<URL>]
message:
- "&7Join our Discord: (Click here)[<https://discord.gg/2qCMn6KHj4>]"
- "&7Visit our website: (Website)[<https://example.com>]"
- "&7Support: (GitHub)[<https://github.com/user/repo>]"
  1. Use Comments - Add comments to explain complex configurations
  2. Test Changes - Use /customcommands reload to test changes
  3. Backup Configs - Keep backups of working configurations
  4. Check Logs - Monitor logs for configuration errors
  5. Use Permissions - Set appropriate permissions for all commands
  1. Missing Quotes - Always wrap strings in quotes
  2. Incorrect Indentation - Use spaces, not tabs
  3. Invalid YAML - Check for syntax errors
  4. Missing Permissions - Ensure all commands have permissions
  5. Circular References - Avoid referencing non-existent commands

Use the reload command to apply changes without restarting:

/customcommands reload
/cc reload
  • All command configurations
  • All message configurations
  • Permission settings
  • Debug settings
  1. Validates configuration files
  2. Loads new configurations
  3. Registers updated commands
  4. Applies new messages
  5. Reports success or errors

Now that you understand the configuration system:

  1. Check out Examples - See practical configuration examples
  2. Read the Commands Guide - Learn about available commands
  3. Explore Permissions - Set up proper permission systems
  4. Advanced Features - Learn about nested subcommands, arguments, player-args, and execution types

:::tip Advanced Configuration For advanced features like nested subcommands, argument validation, player-specific arguments, and command execution types, see our Advanced Features Guide. :::

For support and updates, join our Discord server.