Best Practices
Guidelines for creating effective and maintainable commands with Command Maker.
Naming Conventions
Alias Names
- Use lowercase:
/helloinstead of/Hello - Single word:
/teleportnot/t p - Descriptive:
/warp_homebetter than/w1 - Avoid conflicts: Don't name alias same as Minecraft command
- Use underscores:
/set_spawnfor multi-word names
Variable Names
GOOD:
${server_name}
${player_count}
${spawn_coordinates}
AVOID:
${s}
${pcount}
${SpawnCoords}
Syntax Pattern Names
{
"teleport_player": {
"pattern": "/tp <player>",
"description": "Teleport to a player"
},
"ban_with_reason": {
"pattern": "/ban <player> <reason>",
"description": "Ban a player with reason"
}
}
Organization
Group Related Aliases
In your aliases.json, organize by category:
{
// === TELEPORT COMMANDS ===
"spawn": "tp ${player} 0 65 0",
"home": "tp ${player} ${home_coords}",
"arena": "tp ${player} ${arena_coords}",
// === PLAYER COMMANDS ===
"heal": "effect give @s instant_health 1",
"feed": "effect give @s saturation 1",
// === ADMIN COMMANDS ===
"announce": "say [ANNOUNCEMENT] ",
"shutdown": "say Server shutting down..."
}
Comment Your Config
// Spawn and home teleport system
"spawn": "tp ${player} 0 65 0",
"home": "tp ${player} ${home_coords}",
// Healing items
"heal": "effect give @s instant_health 1",
JSON Configuration Quality
Valid JSON
- Use a JSON validator like JSONLint
- No trailing commas
- Always quote keys:
"key" - Always quote string values
- Escape quotes inside strings:
\"
JSON Formatting
// CORRECT:
{
"key": "value",
"nested": {
"inner": "data"
}
}
// WRONG:
{
key: value,
nested: { inner: data }
}
File Encoding
- Save as UTF-8 (default in most editors)
- Never use BOM (Byte Order Mark)
- Use consistent indentation (2 or 4 spaces)
Security & Permissions
Restrict Dangerous Commands
// Only give admin permissions to these
/addcommand add ban ban-ip ${ban_player}
/addcommand add stop stop
/addcommand add pardon pardon ${player}
Use Operator Permission Checks
{
"admin_command": "execute if entity @s[gamemode=creative] run say Admin mode active"
}
Validate Input
Be careful with user-provided parameters:
{
"safe_tp": "execute in overworld run tp ${player} ${tp_player}"
}
Usability
Clear Feedback
Always tell users the command worked:
GOOD:
"spawn": "tp ${player} 0 65 0 && say Teleported to spawn!"
AVOID:
"spawn": "tp ${player} 0 65 0"
Help Text
Create a help command:
/addcommand add help say Available commands: /spawn /home /arena /heal
/addcommand add help_admin say Admin: /ban /kick /stop /announce
Error Handling
Use || for fallback commands:
{
"teleport_safe": "execute at ${tp_player} run tp ${player} @s || say Player not found"
}
Command Design
Keep Commands Simple
Good: One clear purpose
/heal - Heals the player
/feed - Feeds the player
/speed 2 - Sets speed level
Avoid: Too many features in one alias
// DON'T do this:
"do_everything": "kill @e && give @a diamond && ban @a && tp @a 0 0 0"
Consistency
- Use same format for similar commands
- If teleport commands use coordinates, use format everywhere
- If ban includes reason, always include reason
- Consistent feedback messages
Testing
Test each command before deployment:
- Create simple test:
/addcommand add test say Works - Run
/testto verify - Run
/addcommand reload - Test all aliases after reload
- Test with different users if possible
Performance
Avoid Heavy Selector Usage
GOOD:
"broadcast": "say ${message}" (targeted)
AVOID:
"broadcast": "say @a ${message}" (affects all players each time)
Limit Particle Effects
GOOD: 5-10 particles per command
"warp": "particle end_rod ~ ~ ~ 0.5 0.5 0.5 0.1 5 && tp ${player} 1000 100 1000"
AVOID: 100+ particles
"warp": "particle end_rod ~ ~ ~ 1 1 1 0.5 100 && tp ${player} 1000 100 1000"
Chain vs Schedule
// Immediate execution:
"fast_cmd": "say 1 && say 2 && say 3"
// Delayed execution:
"delayed_cmd": "say Starting && schedule function my_ns:delayed_tasks 60t"
Maintenance
Backup Configuration
- Keep backup of
config/CommandMaker/folder - Before major changes, copy the folder
- Date backup folders:
backup_2025-01-15
Documentation
Document your custom syntax patterns:
// TPA System - Allows players to request teleportation
// Usage: /tpa
// The target player receives a message with /tpaccept and /tpadeny commands
"tpa": {
"pattern": "/tpa <player>",
"description": "Send teleport request to another player"
}
Version Control
If using version control:
.gitignore:
config/CommandMaker/variables.json
config/CommandMaker/*.tmp
Common Mistakes to Avoid
| Mistake | Problem | Solution |
|---|---|---|
${Player} vs ${player} |
Case sensitivity error | Always use lowercase |
| Trailing commas in JSON | JSON parse error | Remove last comma in objects |
| Single quotes in JSON | Invalid JSON | Use double quotes only |
| Forgetting to reload | Changes don't apply | Run /addcommand reload |
| Too complex commands | Hard to debug/maintain | Split into multiple aliases |
| No feedback messages | Confusing for users | Add say feedback |
Server Administration
Moderation Commands
- Always include reason for bans/kicks
- Log actions to console/chat
- Allow staff to appeal decisions
- Keep consistent punishment levels
User Experience
- Make commands intuitive
- Use
/helpto show available commands - Provide feedback for every action
- Avoid destructive aliases without confirmation
Public vs Private
Use operator permission checks:
{
"admin_say": "execute if entity @s[gamemode=creative] run say ${message} || say No permission"
}
✨ Summary
Follow these practices for maintainable, user-friendly commands:
- ✓ Use clear naming conventions
- ✓ Keep commands simple and focused
- ✓ Provide user feedback
- ✓ Test thoroughly
- ✓ Document your work
- ✓ Backup configurations
- ✓ Prioritize security