The Command Event is fired whenever a command is executed. You can react to the command by providing a command handler. See Crafttweaker examples for an example.

You will need to cast the event in the function header as this class: crafttweaker.event.CommandEvent. It is advised to import the class

Copy
import crafttweaker.event.CommandEvent;

Event interface extensions

Link to event-interface-extensions

Command event implements the following interfaces:

ZenGetters/ZenSetters

Link to zengetterszensetters

The following information ca be retrieved/set during the event:

ZenGetterZenSetterType
ZenGetter
commandSender
ZenSetter
no
Type
ICommandSender
ZenGetter
command
ZenSetter
no
Type
ICommand
ZenGetter
parameters
ZenSetter
parameters
Type
string array