Class ScriptCommandExecutionEvent

java.lang.Object
org.bukkit.event.Event
org.skriptlang.skript.bukkit.command.custom.ScriptCommandEvent
org.skriptlang.skript.bukkit.command.custom.ScriptCommandExecutionEvent

public class ScriptCommandExecutionEvent extends ScriptCommandEvent
Event for executing StructCommand commands with.
  • 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

      public String getLabel()
      Returns:
      The label of the executed command.
    • getRawInput

      public String getRawInput()
      Returns:
      The full raw input being executed.
    • getCommandExecutor

      public ScriptCommandExecutor getCommandExecutor()
      Returns:
      The command executor being used to execute this command (perform logic).
    • getArguments

      public Map<String,Object> getArguments()
      Returns:
      A map of all available arguments and their values.
    • getArgument

      public Object getArgument(String name)
      Obtains an argument by its name.
      Parameters:
      name - The name of the argument.
      Returns:
      The value of the argument.
    • 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. null indicates that command execution should not fail.