Class ScriptCommandEvent
java.lang.Object
org.bukkit.event.Event
org.skriptlang.skript.bukkit.command.custom.ScriptCommandEvent
- Direct Known Subclasses:
CommandSuggestionEvent, ScriptCommandExecutionEvent
public class ScriptCommandEvent
extends org.bukkit.event.Event
Parent event for all
ScriptBrigadierCommand events/contexts.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionScriptCommandEvent(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context) -
Method Summary
Modifier and TypeMethodDescriptioncom.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> @Nullable org.bukkit.entity.Entity@NotNull org.bukkit.event.HandlerListorg.bukkit.Locationorg.bukkit.command.CommandSenderMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
ScriptCommandEvent
public ScriptCommandEvent(com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> context)
-
-
Method Details
-
getContext
public com.mojang.brigadier.context.CommandContext<io.papermc.paper.command.brigadier.CommandSourceStack> getContext()- Returns:
- All context surrounding the command execution.
-
getSender
public org.bukkit.command.CommandSender getSender()- Returns:
- The sender is the thing that initiated/triggered the execution of the command.
It differs to
getExecutor()in that the executor can be changed by a command, e.g./execute.
-
getExecutor
@Nullable public @Nullable org.bukkit.entity.Entity getExecutor()- Returns:
- The entity that executes the command.
May not always be
getSender()as the executor of a command can be changed to a different entity than the one that triggered the command.
-
getLocation
public org.bukkit.Location getLocation()- Returns:
- The location that the command is being executed at.
-
getHandlers
@Contract("-> fail") @NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-