Argument Processor
The unit that handles the arguments of a Menu.
Info
Some menus support multiple argument processors. The argument processors are executed in the order they are specified in the setting.
The unit that handles the arguments of a Menu.
Some menus support multiple argument processors. The argument processors are executed in the order they are specified in the setting.
argument-processor
section of the menu-settings
.menu-settings:
command: testargs
argument-processor:
hello:
length: 2
suggest:
- Hello you
- Welcome back
action: "tell: &cHello is required"
message:
take-remaining: true
suggest:
- HSGamer
- Minecraft World
action: "tell: &cMessage is required"
button:
slot: 0
id: stone
name: "&bTest Arguments"
lore:
- "{arg_hello}, {arg_message}"
{arg_<processor_name>}
{arg_hello}
, {arg_message}
This is a processor to store the arguments and provide them as Variables
menu-settings:
argument-processor: # Add the processor to the menu
<name>:
type: store # Not needed as it's the default type
action:
- action
- action
- action
- action
invalid-action:
- action
- action
- action
length: <number>
take-remaining: <true/false>
suggest:
- string1
- string2
- string3
check-suggest: <true/false>
length
: the required length of the argumenttake-remaining
: whether to take all remaining argumentssuggest
: the list of suggestions when the player uses tab-completioncheck-suggest
: whether to check the argument against the suggest
listaction
: the Action to be called when the argument length is not enoughinvalid-action
: the Action to be called when the argument is invalidmenu-settings:
command: testargs
argument-processor:
hello:
length: 2
suggest:
- Hello you
- Welcome back
action: "tell: &cHello is required"
message:
take-remaining: true
suggest:
- HSGamer
- Minecraft World
action: "tell: &cMessage is required"
button:
slot: 0
id: stone
name: "&bTest Arguments"
lore:
- "{arg_hello}, {arg_message}"
This is a processor to handle the argument for Player Name
menu-settings:
argument-processor: # Add the processor to the menu
<name>:
type: player
action:
- action
- action
- action
- action
invalid-action:
- action
- action
- action
online-only: <true/false>
online-only
: whether to check if the player is online. If true
, then only the online players are given to the suggestion listaction
: the Action to be called when the argument length is not enoughinvalid-action
: the Action to be called when the argument is invalidmenu-settings:
command: confirmteleport
argument-processor:
player:
type: player
action: "tell: &cPlayer is required"
target:
type: player
action: "tell: &cTarget is required"
button:
slot: 0
id: ender_pearl
name: "&bTeleport"
command: "console: tp {arg_player} {arg_target}"
This is a processor to handle the numeric argument
menu-settings:
argument-processor: # Add the processor to the menu
<name>:
type: number
action:
- action
- action
- action
- action
invalid-action:
- action
- action
- action
suggest:
- 0
- 1
- 2
suggest
: the list of suggestions when the player uses tab-completionaction
: the Action to be called when the argument length is not enoughinvalid-action
: the Action to be called when the argument is invalidmenu-settings:
command: giveapple
argument-processor:
amount:
type: number
action: "tell: &cAmount is required"
button:
slot: 0
id: apple
name: "&bGive apple"
command: "console: give {player} apple {arg_amount}"
This is a processor to handle the decimal argument
menu-settings:
argument-processor: # Add the processor to the menu
<name>:
type: decimal
action:
- action
- action
- action
- action
invalid-action:
- action
- action
- action
suggest:
- 0
- 1
- 2
suggest
: the list of suggestions when the player uses tab-completionaction
: the Action to be called when the argument length is not enoughinvalid-action
: the Action to be called when the argument is invalidmenu-settings:
command: teleportcoords
argument-processor:
x:
type: decimal
action: "tell: &cX is required"
y:
type: decimal
action: "tell: &cY is required"
z:
type: decimal
action: "tell: &cZ is required"
button:
slot: 0
id: ender_pearl
name: "&bTeleport"
command: "console: tp {player} {arg_x} {arg_y} {arg_z}"
This is a processor to handle the argument of Material
menu-settings:
argument-processor: # Add the processor to the menu
<name>:
type: material
action:
- action
- action
- action
- action
invalid-action:
- action
- action
- action
action
: the Action to be called when the argument length is not enoughinvalid-action
: the Action to be called when the argument is invalidmenu-settings:
command: materialview
argument-processor:
material:
type: material
action: "tell: &cMaterial is required"
button:
slot: 0
id: "{arg_material}"
name: "&bMaterial"
This is a processor to handle the argument of Entity
menu-settings:
argument-processor: # Add the processor to the menu
<name>:
type: entity
action:
- action
- action
- action
- action
invalid-action:
- action
- action
- action
action
: the Action to be called when the argument length is not enoughinvalid-action
: the Action to be called when the argument is invalidmenu-settings:
command: spawnentity
argument-processor:
entity:
type: entity
action: "tell: &cEntity is required"
button:
slot: 0
id: "egg"
name: "&bSpawn Entity"
command: "op: spawn {arg_entity}"