emerald-extension / cn.berberman.emerald.dsl.command / DSLCommandBuilder / action

action

var action: Action

Read only, which will be invoked when commands execute.

fun action(block: (CommandSender) -> Boolean): Unit

Set action, only retain parameter command sender

Parameters

block - a function contains the action of execute command, return boolean represents whether command executes successfullyfun action(block: (CommandSender, Array<out String>) -> Boolean): Unit

Set action, retain parameters command sender and command arguments

Parameters

block - a function contains the action of execute command, return boolean represents whether command executes successfully