Class ScriptCommandExecutionEvent
java.lang.Object
org.bukkit.event.Event
org.skriptlang.skript.bukkit.command.custom.ScriptCommandEvent
org.skriptlang.skript.bukkit.command.custom.ScriptCommandExecutionEvent
Event for executing
StructCommand commands with.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionScriptCommandExecutionEvent(String label, String rawInput, ScriptCommandExecutor commandExecutor, com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context) -
Method Summary
Modifier and TypeMethodDescriptiongetArgument(String name) Obtains an argument by its name.@Nullable net.kyori.adventure.text.ComponentgetLabel()intvoidsetFailureMessage(@Nullable net.kyori.adventure.text.Component failureMessage) Sets the failure message for this command execution.voidsetResult(int result) Sets the result for this command execution.Methods inherited from class ScriptCommandEvent
getContext, getExecutor, getHandlers, getLocation, getSenderMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ScriptCommandExecutionEvent
public ScriptCommandExecutionEvent(String label, String rawInput, ScriptCommandExecutor commandExecutor, com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context)
-
-
Method Details
-
getLabel
- Returns:
- The label of the executed command.
-
getRawInput
- Returns:
- The full raw input being executed.
-
getCommandExecutor
- Returns:
- The command executor being used to execute this command (perform logic).
-
getArguments
-
getArgument
-
getResult
public int getResult()- Returns:
- The result for this command execution.
-
setResult
public void setResult(int result) Sets the result for this command execution.- Parameters:
result- The new result value.
-
getFailureMessage
@Nullable public @Nullable net.kyori.adventure.text.Component getFailureMessage()- Returns:
- A component describing why this command execution failed. Null if this command execution did not fail.
-
setFailureMessage
public void setFailureMessage(@Nullable @Nullable net.kyori.adventure.text.Component failureMessage) Sets the failure message for this command execution.- Parameters:
failureMessage- A component describing why this command execution failed.nullindicates that command execution should not fail.
-