Configuration
Configuration
Section titled “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.
Configuration Files
Section titled “Configuration Files”File Structure
Section titled “File Structure”plugins/CustomCommands/├── config.yml # Command definitions and settings├── messages.yml # All plugin messages and prefix└── logs/ # Log files (auto-generated)config.yml
Section titled “config.yml”The main configuration file where you define your custom commands and plugin settings.
Debug Settings
Section titled “Debug Settings”debug: enabled: true # Enable/disable debug mode console: true # Show debug messages in console file: true # Write debug messages to log filesDebug Mode:
enabled: true- Enables detailed logging for troubleshootingconsole: true- Shows debug messages in server consolefile: true- Writes debug messages to log files
Command Configuration
Section titled “Command Configuration”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"Command Properties
Section titled “Command Properties”Basic Properties
Section titled “Basic Properties”permission- Required permission to use the commandalias- Alternative command names (players can use these instead)description- Description shown in/helpcommandenabled- Enable or disable the command (true/false)cooldown- Cooldown in seconds (0= no cooldown)
Message Properties
Section titled “Message Properties”message- List of messages sent when command is used (optional - can be omitted)commands- Commands executed when command is used (usetypeto control execution type)subcommands- Subcommands for tab completion (optional)
Example Commands
Section titled “Example Commands”Discord Command
Section titled “Discord Command”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"Command Without Messages
Section titled “Command Without Messages”silent: permission: "customcommands.silent" commands: # No message field - command executes silently - "effect give {player} minecraft:invisibility 30 1 true"Website Command with Cooldown
Section titled “Website Command with Cooldown”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 Command
Section titled “Rules Command”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
Section titled “Subcommands”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. :::
Console Commands
Section titled “Console Commands”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.
:::
Available Variables
Section titled “Available Variables”{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)
messages.yml
Section titled “messages.yml”The messages configuration file contains all plugin messages and the prefix.
Prefix Configuration
Section titled “Prefix Configuration”prefix: "�FFAA[CustomCommands] "The prefix is automatically replaced in all messages that contain {prefix}.
Message Categories
Section titled “Message Categories”General Messages
Section titled “General Messages”welcome: "`{prefix}`&aWelcome to the Custom Commands plugin!"plugin_enabled: "`{prefix}`&aPlugin has been enabled successfully!"plugin_disabled: "`{prefix}`&cPlugin has been disabled!"Reload Messages
Section titled “Reload Messages”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 Messages
Section titled “Command Messages”command_not_found: "`{prefix}`&cCommand not found: {command}"command_no_permission: "`{prefix}`&cYou don't have permission to use this command!"Custom Command Messages
Section titled “Custom Command Messages”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 Messages
Section titled “Info Messages”info_version: "`{prefix}`&eCustom Commands v{version}"info_author: "`{prefix}`&eAuthor: {author}"info_help: "`{prefix}`&eUse /customcommands help for available commands"Support Messages
Section titled “Support Messages”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 Messages
Section titled “Help Messages”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=============================="Color Codes
Section titled “Color Codes”Traditional Color Codes
Section titled “Traditional Color Codes”&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 = WhiteFormatting Codes
Section titled “Formatting Codes”&l = Bold&n = Underline&o = Italic&k = Magic (random characters)&m = Strikethrough&r = Reset (removes all formatting)Hex Colors
Section titled “Hex Colors”&#FF8800 = Orange�FFAA = Cyan&#FF0000 = Red�FF00 = Green�FF = BlueClickable Links
Section titled “Clickable Links”Syntax
Section titled “Syntax”(Display Text)[<URL>]Examples
Section titled “Examples”message: - "&7Join our Discord: (Click here)[<https://discord.gg/2qCMn6KHj4>]" - "&7Visit our website: (Website)[<https://example.com>]" - "&7Support: (GitHub)[<https://github.com/user/repo>]"Configuration Tips
Section titled “Configuration Tips”Best Practices
Section titled “Best Practices”- Use Comments - Add comments to explain complex configurations
- Test Changes - Use
/customcommands reloadto test changes - Backup Configs - Keep backups of working configurations
- Check Logs - Monitor logs for configuration errors
- Use Permissions - Set appropriate permissions for all commands
Common Mistakes
Section titled “Common Mistakes”- Missing Quotes - Always wrap strings in quotes
- Incorrect Indentation - Use spaces, not tabs
- Invalid YAML - Check for syntax errors
- Missing Permissions - Ensure all commands have permissions
- Circular References - Avoid referencing non-existent commands
Reloading Configuration
Section titled “Reloading Configuration”Hot Reload
Section titled “Hot Reload”Use the reload command to apply changes without restarting:
/customcommands reload/cc reloadWhat Gets Reloaded
Section titled “What Gets Reloaded”- All command configurations
- All message configurations
- Permission settings
- Debug settings
Reload Process
Section titled “Reload Process”- Validates configuration files
- Loads new configurations
- Registers updated commands
- Applies new messages
- Reports success or errors
Next Steps
Section titled “Next Steps”Now that you understand the configuration system:
- Check out Examples - See practical configuration examples
- Read the Commands Guide - Learn about available commands
- Explore Permissions - Set up proper permission systems
- 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.