Creating Custom Commands
Learn how to create custom commands from simple aliases to advanced multi-parameter systems.
Three Ways to Create Commands
1️⃣ Simple Aliases (Easiest)
Quick shortcuts to existing commands:
/cmd add hello say Hello ${player}!
2️⃣ Custom Syntax (Intermediate)
Add parameters to your commands:
Pattern: /tpa <player>
Command: /tpa Steve
3️⃣ Complex Systems (Advanced)
Multi-step commands with multiple parameters and effects.
Step-by-Step: Creating Your First Command
Step 1: Plan Your Command
What do you want it to do?
- Name:
hello - Purpose: Greet the player
- Action: Say a message
Step 2: Create the Alias
In-game, run:
/cmd add hello say Hello ${player}! Welcome to our server!
Step 3: Test It
Run your new command:
/hello
Expected output: "Hello [YourName]! Welcome to our server!"
Step 4: Perfect It
Add effects or improve the message:
/cmd add hello say Hello ${player}! && playsound entity.player.levelup
Common Command Types
Chat Commands
/cmd add hello say Hello world!
/cmd add rules say Read the rules at /rules-site
/cmd add staff say Contact staff at support@example.com
Teleport Commands
/cmd add spawn tp ${player} 0 65 0
/cmd add home tp ${player} 100 65 100
/cmd add arena tp ${player} 500 100 500
Item Commands
/cmd add heal effect give @s instant_health 1
/cmd add feed effect give @s saturation 1
/cmd add night_vision effect give @s night_vision 1000
Permission-Based Commands
/cmd add admin execute if entity @s[gamemode=creative] run say Admin mode
/cmd add staff execute if entity @s[gamemode=creative] run say Staff panel
Multiple Action Commands
/cmd add party playsound music_disc.pigstep && say Party started!
/cmd add lights effect give @a glowing 120
/cmd add announce say [ANNOUNCEMENT] Server maintenance in 10 minutes
Using Variables
Player Name
/cmd add greet say Hi ${player}!
/cmd add location say ${player} is at ${x} ${y} ${z}
Custom Variables
/setcmdvariable server_ip mc.example.com:25565
/setcmdvariable discord https://discord.gg/example
/setcmdvariable version 1.0.0
/cmd add ip say Connect to: ${server_ip}
/cmd add discord say Join: ${discord}
/cmd add version say Server version: ${version}
Coordinates
/cmd add coords say You are at: ${x}, ${y}, ${z}
/cmd add home_set setblock ${x} ${y} ${z} diamond_block
/cmd add place_marker setblock ${x} ~ ${z} oak_sign
Creating Command Groups
Organize related commands:
Help System
/cmd add help say Commands: /hello /rules /staff /version
/cmd add help_admin say Admin: /ban /kick /announce /shutdown
Hub Commands
Game Commands
/cmd add arena_join tp ${player} 1000 100 1000
/cmd add arena_leave tp ${player} 0 65 0
/cmd add arena_reset setblock 1000 100 1000 air
/cmd add arena_start say Arena starting!
/cmd add arena_end say Arena ended!
Advanced: Multi-Parameter Commands
Define the Pattern
Edit config/CommandMaker/syntax.json:
{
"give_item": {
"pattern": "/give_item <player> <amount>",
"description": "Give items to a player"
}
}
Create the Alias
Edit config/CommandMaker/aliases.json:
{
"give_item": "give ${give_item_player} diamond ${give_item_amount} && say Gave ${give_item_amount} diamonds to ${give_item_player}"
}
Use It
/give_item Steve 10
Output: "Gave 10 diamonds to Steve"
Tips & Tricks
Use Feedback Messages
Good:
/cmd add teleport tp ${player} 1000 100 1000 && say Teleported to Arena!
Avoid:
/cmd add teleport tp ${player} 1000 100 1000
Chain Commands with &&
/cmd add party say Party started! && playsound music_disc.pigstep
Use Colors in Messages
/cmd add success say {"text":"Success!","color":"green"}
/cmd add error say {"text":"Error!","color":"red"}
Add Sound Effects
/cmd add levelup playsound entity.player.levelup
/cmd add click playsound ui.button.click
/cmd add success playsound entity.ender_pearl.sound
Combine Effects
/cmd add epic particle end_rod ~ ~ ~ 1 1 1 0.1 20 && playsound entity.enderman.teleport && say Epic!
Testing Commands
Test Template
For each command:
- Create it:
/cmd add test_cmd ... - Run it:
/test_cmd - Check output: Does it work?
- Reload:
/cmd reload - Test again:
/test_cmd - Check with other players (multiplayer)
Debugging
If command doesn't work:
- Verify alias exists:
/cmd list - Check for typos
- Reload config:
/cmd reload - Test underlying command directly
- Check JSON syntax if using syntax.json
Real-World Examples
Welcome Command
/cmd add welcome say Welcome to ${server_name}, ${player}!
/cmd add welcome_advanced say Welcome ${player}! && say Type /help for commands && playsound entity.player.levelup
Shop System
/cmd add shop_sell execute at ${player} run particle glow_ink_sac ~ ~ ~ 0.5 0.5 0.5 0.1 20
/cmd add shop_open say Opening shop...
Rank System
/cmd add vip say ${player} is VIP level 1
/cmd add admin_panel execute if entity @s[gamemode=creative] run say Admin controls active
/cmd add become_vip execute if entity @s[name=Owner] run say ${player} is now VIP
Minigame Setup
/cmd add start_game say Game starting! && effect give @a speed 600 2
/cmd add end_game say Game over! && effect clear @a speed
/cmd add reset_game say Resetting arena... && setblock 0 0 0 air
Best Practices
- Keep it simple: One command, one purpose
- Give feedback: Always tell users if the command worked
- Test thoroughly: Try it in different scenarios
- Use variables: Make commands dynamic
- Document: Remember what each command does
- Backup: Keep copies of working configs
💡 Pro Tip
Start simple and build up. Create a basic command first, test it, then add effects and features!
Next Steps
- See more examples of popular systems
- Learn custom syntax for parameters
- Master variables for dynamic commands
- Troubleshoot issues if commands don't work