Skip to Content
For more plugins like this, check out: https://dannb.online/ šŸŽ‰
Getting StartedCommand Syntax & Parameters

Command Syntax & Parameters

The command: field tells the plugin what the command looks like and which parameters should be captured.

Basic format

command: /alert [message:greedy_string]

This means:

  • the command label is /alert
  • it takes one parameter named message
  • that parameter uses the type greedy_string

Parameters are written in this format:

[name:type]

Example:

command: /mail [target:player] [message:greedy_string]

Supported parameter types

The code supports exactly these four types:

  • string
  • greedy_string
  • player
  • word

What each type does

word

Captures a single word with no spaces.

command: /tag [category:word]

Good for categories, flags, short names, and simple modes.

string

Captures a normal Brigadier string argument.

command: /setrank [rank:string]

Use this for single values where spaces are not required.

player

Captures a player name and gives username suggestions from online players.

command: /inspect [target:player]

This is especially useful when you want tab-complete suggestions.

greedy_string

Captures everything from that point to the end of the command.

command: /announce [message:greedy_string]

If the player runs:

/announce Server restart in 5 minutes

Then %message% becomes:

Server restart in 5 minutes

Critical rule: greedy_string must be last

The registration code explicitly validates this.

Correct:

command: /note [category:word] [message:greedy_string]

Incorrect:

command: /note [message:greedy_string] [category:word]

If greedy_string is not the final parameter, command registration fails.

Parameters become placeholders

Each parameter becomes a placeholder with the same name.

command: /warn [playerName:player] [reason:greedy_string] message: "<red>Warned %playerName% for %reason%"

If the command is:

/warn Steve Spamming chat

Then:

  • %playerName% becomes Steve
  • %reason% becomes Spamming chat

Usage messages

If a command has parameters and a player runs it without enough arguments, the plugin sends a usage message based on your command: field.

That means this field is both a parser definition and a built-in help line, so keep it clear and readable.

One short option plus free text

command: /ticket [type:word] [message:greedy_string]

Player target plus free text

command: /mail [target:player] [message:greedy_string]

Single player target

command: /inspect [target:player]

Things to avoid

Do not invent parameter types

Only the four built-in types are accepted.

Do not expect spaces in word

If the value may contain spaces, use greedy_string instead.

Do not put display formatting into the syntax itself

The command: field defines input, not output formatting.

Last updated on