Class CommandExecuteEvent
- java.lang.Object
-
- com.velocitypowered.api.event.command.CommandExecuteEvent
-
- All Implemented Interfaces:
ResultedEvent<CommandExecuteEvent.CommandResult>
public final class CommandExecuteEvent extends Object implements ResultedEvent<CommandExecuteEvent.CommandResult>
This event is fired when someone executing command.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CommandExecuteEvent.CommandResult
Represents 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 String
getCommand()
Gets the original command being executed without first slash.CommandSource
getCommandSource()
CommandExecuteEvent.CommandResult
getResult()
Returns the result associated with this event.void
setResult(CommandExecuteEvent.CommandResult result)
Sets the result of this event.String
toString()
-
-
-
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 first slash.- Returns:
- the original command being executed
-
getResult
public CommandExecuteEvent.CommandResult getResult()
Description copied from interface:ResultedEvent
Returns the result associated with this event.- Specified by:
getResult
in interfaceResultedEvent<CommandExecuteEvent.CommandResult>
- Returns:
- the result of this event
-
setResult
public void setResult(CommandExecuteEvent.CommandResult result)
Description copied from interface:ResultedEvent
Sets the result of this event. The result must be non-null.- Specified by:
setResult
in interfaceResultedEvent<CommandExecuteEvent.CommandResult>
- Parameters:
result
- the new result
-
-