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:

/addcommand 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?

Step 2: Create the Alias

In-game, run:

/addcommand 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:

/addcommand add hello say Hello ${player}! && playsound entity.player.levelup

Common Command Types

Chat Commands

/addcommand add hello say Hello world!
/addcommand add rules say Read the rules at /rules-site
/addcommand add staff say Contact staff at support@example.com

Teleport Commands

/addcommand add spawn tp ${player} 0 65 0
/addcommand add home tp ${player} 100 65 100
/addcommand add arena tp ${player} 500 100 500

Item Commands

/addcommand add heal effect give @s instant_health 1
/addcommand add feed effect give @s saturation 1
/addcommand add night_vision effect give @s night_vision 1000

Permission-Based Commands

/addcommand add admin execute if entity @s[gamemode=creative] run say Admin mode
/addcommand add staff execute if entity @s[gamemode=creative] run say Staff panel

Multiple Action Commands

/addcommand add party playsound music_disc.pigstep && say Party started!
/addcommand add lights effect give @a glowing 120
/addcommand add announce say [ANNOUNCEMENT] Server maintenance in 10 minutes

Using Variables

Player Name

/addcommand add greet say Hi ${player}!
/addcommand 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

/addcommand add ip say Connect to: ${server_ip}
/addcommand add discord say Join: ${discord}
/addcommand add version say Server version: ${version}

Coordinates

/addcommand add coords say You are at: ${x}, ${y}, ${z}
/addcommand add home_set setblock ${x} ${y} ${z} diamond_block
/addcommand add place_marker setblock ${x} ~ ${z} oak_sign

Creating Command Groups

Organize related commands:

Help System

/addcommand add help say Commands: /hello /rules /staff /version
/addcommand add help_admin say Admin: /ban /kick /announce /shutdown

Hub Commands

Game Commands

/addcommand add arena_join tp ${player} 1000 100 1000
/addcommand add arena_leave tp ${player} 0 65 0
/addcommand add arena_reset setblock 1000 100 1000 air
/addcommand add arena_start say Arena starting!
/addcommand 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:

/addcommand add teleport tp ${player} 1000 100 1000 && say Teleported to Arena!

Avoid:

/addcommand add teleport tp ${player} 1000 100 1000

Chain Commands with &&

/addcommand add party say Party started! && playsound music_disc.pigstep

Use Colors in Messages

/addcommand add success say {"text":"Success!","color":"green"}
/addcommand add error say {"text":"Error!","color":"red"}

Add Sound Effects

/addcommand add levelup playsound entity.player.levelup
/addcommand add click playsound ui.button.click
/addcommand add success playsound entity.ender_pearl.sound

Combine Effects

/addcommand add epic particle end_rod ~ ~ ~ 1 1 1 0.1 20 && playsound entity.enderman.teleport && say Epic!

Testing Commands

Test Template

For each command:

  1. Create it: /addcommand add test_cmd ...
  2. Run it: /test_cmd
  3. Check output: Does it work?
  4. Reload: /addcommand reload
  5. Test again: /test_cmd
  6. Check with other players (multiplayer)

Debugging

If command doesn't work:

Real-World Examples

Welcome Command

/addcommand add welcome say Welcome to ${server_name}, ${player}!
/addcommand add welcome_advanced say Welcome ${player}! && say Type /help for commands && playsound entity.player.levelup

Shop System

/addcommand add shop_sell execute at ${player} run particle glow_ink_sac ~ ~ ~ 0.5 0.5 0.5 0.1 20
/addcommand add shop_open say Opening shop...

Rank System

/addcommand add vip say ${player} is VIP level 1
/addcommand add admin_panel execute if entity @s[gamemode=creative] run say Admin controls active
/addcommand add become_vip execute if entity @s[name=Owner] run say ${player} is now VIP

Minigame Setup

/addcommand add start_game say Game starting! && effect give @a speed 600 2
/addcommand add end_game say Game over! && effect clear @a speed
/addcommand add reset_game say Resetting arena... && setblock 0 0 0 air

Best Practices

💡 Pro Tip

Start simple and build up. Create a basic command first, test it, then add effects and features!

Next Steps