# Custom Commands Major Update - Arguments, Nesting & Player Validation
## 🎮 New Features
We've added three powerful features that make custom commands more flexible and user-friendly!
### ✨ Feature 1: Arguments System
**Dynamic Command Arguments**
- Add arguments to any custom command or subcommand
- Use `{args}` variable in messages and commands to access arguments
- Configure whitelists, validation, and required arguments
- Support for arguments with spaces
**Configuration:**
```yaml
arguments:
whitelist: ["hello", "goodbye"] # Allowed arguments
whitelist-only: true # Only allow whitelisted args
no-arguments: true # Allow command without args
invalid-message: "&cInvalid arguments!"
```
**Example:**
```yaml
say:
arguments:
whitelist: ["hello", "goodbye", "help"]
whitelist-only: true
commands:
- "say {player}: {args}" # Use {args} in commands
```
### ✨ Feature 2: Nested Subcommands
**Unlimited Command Nesting**
- Subcommands can now have their own subcommands (unlimited depth!)
- Perfect for organizing complex command structures
- Each level has its own permissions and messages
**Example:**
```yaml
admin:
subcommands:
player:
subcommands: # Nested subcommands!
kick:
commands:
- "kick {args} Kicked by admin"
ban:
commands:
- "ban {args} Banned by admin"
```
**Usage:**
- `/admin player kick Steve` - Kicks a player
- `/admin player ban Steve` - Bans a player
- `/admin server restart` - Restarts the server
### ✨ Feature 3: Player Arguments (`player-args`)
**Automatic Player Validation**
- Mark specific arguments as player names using `player-args: [0]`
- Automatic validation ensures players exist and are online
- Smart tab-completion shows all online players
- Clear error messages for invalid players
**Configuration:**
```yaml
kick:
arguments:
player-args: [0] # First argument = player name
no-arguments: false
commands:
- "kick {args} Kicked by {player}"
```
**Features:**
- ✅ Prevents typos and invalid player names
- ✅ Faster command usage with tab-completion
- ✅ Works with nested subcommands
- ✅ Multiple player arguments supported: `player-args: [0, 1]`
### 📝 Combined Example
All three features work together perfectly:
```yaml
admin:
permission: "customcommands.admin"
subcommands:
player:
permission: "customcommands.admin.player"
subcommands: # Nested subcommands
kick:
permission: "customcommands.admin.player.kick"
arguments:
player-args: [0] # Player validation
no-arguments: false
commands:
- "kick {args} Kicked by {player}"
```
**Usage:** `/admin player kick Steve`
- Uses nested subcommands (`admin` → `player` → `kick`)
- Validates that `Steve` is a valid online player
- Executes the kick command with the player name
### 🎯 Benefits
**Arguments System:**
- ✅ Flexible command input
- ✅ Input validation
- ✅ Whitelist support
- ✅ Use arguments in messages and commands
**Nested Subcommands:**
- ✅ Better command organization
- ✅ Unlimited nesting depth
- ✅ Individual permissions per level
- ✅ Clean command structure
**Player Arguments:**
- ✅ Automatic player validation
- ✅ Tab-completion for players
- ✅ Error prevention
- ✅ Better user experience
---
**Full Changelog:**
- Added arguments system with whitelist and validation support
- Implemented nested subcommands (unlimited depth)
- Added `player-args` configuration for automatic player name validation
- Implemented automatic tab-completion for player arguments
- Added player-specific error messages
- Fixed spam issue with tellraw commands
- Improved argument handling and validation
- Enhanced tab-completion system
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }