Class ClientCommandEvent
java.lang.Object
dev.overlord.zomboidforge.api.ClientCommandEvent
- All Implemented Interfaces:
Cancellable, Event, MainThreadEvent
A client command arrived: a client called Lua's
sendClientCommand(module, command, args).
Posted on the main thread for every client command, including those of Project Zomboid and of
Lua mods, so listeners filter by module().
Default action: Project Zomboid passes the command to Lua's Events.OnClientCommand.
cancel() prevents that, for example when a Java mod handles the module itself.
args() is the Lua table converted to Java: keys are String or
Double (Lua arrays have the keys 1.0, 2.0, ...), values are
String, Double, Boolean, a nested Map of the same kind, or a
game object that Project Zomboid sends with commands (in Build 42 an inventory item, an
IsoDirections, or a dead body). The maps cannot be modified.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ClientCommandEvent
-
-
Method Details
-
player
The player who sent the command. -
module
-
command
-
args
-
cancel
public void cancel()Description copied from interface:CancellablePrevents the default action.- Specified by:
cancelin interfaceCancellable
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceCancellable
-
toString
-