Interface ExecuteCommandEvent.Pre
- 
- All Superinterfaces:
- Cancellable,- Event,- ExecuteCommandEvent
 - Enclosing interface:
- ExecuteCommandEvent
 
 public static interface ExecuteCommandEvent.Pre extends ExecuteCommandEvent, Cancellable Fired before the command is executed.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface org.spongepowered.api.event.command.ExecuteCommandEventExecuteCommandEvent.Post, ExecuteCommandEvent.Pre
 
- 
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanisCancelled()If true, the command will not run and theCommandResultgiven byresult()will be returned.Optional<CommandResult>result()The result of the command.voidsetArguments(String arguments)Sets the arguments as a string.voidsetCancelled(boolean cancel)Sets whether the command will run.voidsetCommand(String command)Sets the command as a string, without any sort of command prefix.voidsetResult(@Nullable CommandResult result)Sets the result of the command.- 
Methods inherited from interface org.spongepowered.api.event.command.ExecuteCommandEventarguments, command, commandCause, originalArguments, originalCommand
 
- 
 
- 
- 
- 
Method Detail- 
setCommandvoid setCommand(String command) Sets the command as a string, without any sort of command prefix.For example, if the message was /example bob 3 -f, then the command would beexample.- Parameters:
- command- The command
 
 - 
setArgumentsvoid setArguments(String arguments) Sets the arguments as a string.For example, if the message was /example bob 3 -f, then the arguments would bebob 3 -f.- Parameters:
- arguments- The arguments
 
 - 
resultOptional<CommandResult> result() The result of the command.If set, this indicates cancellation of the command. - Returns:
- The result of the command, if set.
 
 - 
setResultvoid setResult(@Nullable CommandResult result) Sets the result of the command.- Parameters:
- result- The result of the command
 
 - 
isCancelledboolean isCancelled() If true, the command will not run and theCommandResultgiven byresult()will be returned.- Specified by:
- isCancelledin interface- Cancellable
- Returns:
- The cancellation status of the event.
 
 - 
setCancelledvoid setCancelled(boolean cancel) Sets whether the command will run. If the command is cancelled using this method, an appropriateCommandResultwill be set (and returned fromresult()).- Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- The new cancelled state
 
 
- 
 
-