Class CommandExecuteEvent
- java.lang.Object
-
- com.velocitypowered.api.event.command.CommandExecuteEvent
-
- All Implemented Interfaces:
ResultedEvent<CommandExecuteEvent.CommandResult>
@AwaitingEvent public final class CommandExecuteEvent extends Object implements ResultedEvent<CommandExecuteEvent.CommandResult>
This event is fired when someone executes a command. Velocity will wait for this event to finish firing before trying to handle the command and/or forwarding it to the server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCommandExecuteEvent.CommandResultRepresents the result of theCommandExecuteEvent.-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
-
Constructor Summary
Constructors Constructor Description CommandExecuteEvent(CommandSource commandSource, String command)Constructs a CommandExecuteEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetCommand()Gets the original command being executed without the first slash.CommandSourcegetCommandSource()CommandExecuteEvent.CommandResultgetResult()Returns the result associated with this event.voidsetResult(CommandExecuteEvent.CommandResult result)Sets the result of this event.StringtoString()
-
-
-
Constructor Detail
-
CommandExecuteEvent
public CommandExecuteEvent(CommandSource commandSource, String command)
Constructs a CommandExecuteEvent.- Parameters:
commandSource- the source executing the commandcommand- the command being executed without first slash
-
-
Method Detail
-
getCommandSource
public CommandSource getCommandSource()
-
getCommand
public String getCommand()
Gets the original command being executed without the first slash.- Returns:
- the original command being executed
-
getResult
public CommandExecuteEvent.CommandResult getResult()
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
getResultin interfaceResultedEvent<CommandExecuteEvent.CommandResult>- Returns:
- the result of this event
-
setResult
public void setResult(CommandExecuteEvent.CommandResult result)
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<CommandExecuteEvent.CommandResult>- Parameters:
result- the new result
-
-