Package net.minecraftforge.event
Class CommandEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.Event
-
- net.minecraftforge.event.CommandEvent
-
public class CommandEvent extends net.minecraftforge.eventbus.api.Event
CommandEvent is fired after a command is parsed, but before it is executed. This event is fired during the invocation ofCommands#handleCommand(CommandSource, String)
.
parse
contains the instance ofParseResults
for the parsed command.
exception
begins null, but can be populated with an exception to be thrown within the command.
This event isCancelable
.
If the event is canceled, the execution of the command does not occur.
This event does not have a result.Event.HasResult
This event is fired on theMinecraftForge.EVENT_BUS
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Throwable
exception
private com.mojang.brigadier.ParseResults<CommandSource>
parse
-
Constructor Summary
Constructors Constructor Description CommandEvent(com.mojang.brigadier.ParseResults<CommandSource> parse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Throwable
getException()
com.mojang.brigadier.ParseResults<CommandSource>
getParseResults()
void
setException(java.lang.Throwable exception)
void
setParseResults(com.mojang.brigadier.ParseResults<CommandSource> parse)
-
-
-
Field Detail
-
parse
private com.mojang.brigadier.ParseResults<CommandSource> parse
-
exception
private java.lang.Throwable exception
-
-
Constructor Detail
-
CommandEvent
public CommandEvent(com.mojang.brigadier.ParseResults<CommandSource> parse)
-
-
Method Detail
-
getParseResults
public com.mojang.brigadier.ParseResults<CommandSource> getParseResults()
-
setParseResults
public void setParseResults(com.mojang.brigadier.ParseResults<CommandSource> parse)
-
getException
public java.lang.Throwable getException()
-
setException
public void setException(java.lang.Throwable exception)
-
-