Skip to main content

Command Building

Basics

Register server commands under the menu's binding structure

bindings:
command: 'myExampleCommand'
bindings:
command:
name: 'myExampleCommand'
aliases:
- example
description: 'command description'
permission: 'command permission'
permissionMessage: 'no perm'
usage: 'usage info'

Available nodes are as follows:

NodeAccepted ValuesDescription
nameStringCommand name
aliasesString/ListCommand aliases
descriptionStringCommand description
usageStringUsage hint
permissionStringCommand permission
permissionMessageStringPermission message
argumentsListArguments

Simple Arguments

bindings:
command:
name: 'myExampleCommand'
args:
- 'customArg1'
- 'customArg2'
  • To open the menu through this command, two arguments must be provided.
  • Both arguments are automatically registered as variables in the menu context (customArg1, customArg2)
Using Passed Arguments in Menu

Use Kether statement context to access these two automatically registered variables, i.e.
context get customArg1
context get customArg2

Advanced Arguments

bindings:
command:
name: 'sounds'
argument:
- label: filter
type: ANY
restrict: false
optional: true
default: value
suggest:
- ambient
- block
- enchant
- entity
- event
- item
- music
- particle
- ui
- weather

Available nodes for argument objects are as follows:

NodeAccepted ValuesDescription
labelStringArgument name
typeStringArgument type
restrictBoolWhether to restrict argument content to completion options (default false)
optionalBoolWhether optional (default true)
defaultAnyDefault argument value
suggestListCustom completion suggestion content
incorrectMessageStringError message for incorrect arguments
  • label serves as the argument identifier and is also the variable name registered in the menu context
  • type provides multiple types by default, including auto-completion content
TypeDescription
ANYAny
DECIMALNumber
INTEGERInteger
BOOLEANBoolean
PLAYEROnline player name
WORLDWorld name