Custom Syntax System

The Custom Syntax System allows you to define your own command patterns with parameters that automatically substitute into aliases. This is the most powerful feature of Command Maker!

How It Works

Define a pattern → Create an alias using syntax variables → Users type the command → Variables auto-substitute!

Example: TPA System

Step 1: Define Pattern

{
  "tpa": {
    "pattern": "/tpa <player>",
    "description": "Teleport request to a player"
  }
}

Step 2: Create Alias

{
  "tpa_request": "say ${tpa_player} wants to TP to you!"
}

Step 3: Use In-Game

/tpa_request steve

Result: say steve wants to TP to you!

Pattern Syntax

Element Format Example
Pattern Name Key in syntax.json "tpa"
Pattern String /command <param> "/tpa <player>"
Parameter Inside < and > <player>
Variable in Alias ${pattern_param} ${tpa_player}

Multi-Parameter Examples

Ban System

{
  "ban": {
    "pattern": "/ban <player> <reason>",
    "description": "Ban a player with reason"
  }
}

Use in alias: ban ${ban_player} ${ban_reason}

Message System

{
  "msg": {
    "pattern": "/msg <player> <message>",
    "description": "Send a message to a player"
  }
}

Last parameter is greedy and captures everything to the end!

Viewing Defined Patterns

In-game, use:

/syntax

Shows all defined custom syntax patterns and their descriptions.

Best Practices

💡 Advanced Tip

Combine syntax parameters with built-in variables! Example: say ${player} sent TPA to ${tpa_player} from ${x} ${y} ${z}