Package org.bukkit.event.command
Class UnknownCommandEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.command.UnknownCommandEvent
Thrown when a player executes a command that is not defined
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionUnknownCommandEvent
(CommandSourceStack commandSource, String commandLine, @Nullable Component message) -
Method Summary
Modifier and TypeMethodDescriptionGets the command that was sentGets the command source associated with this eventstatic HandlerList
Deprecated.Gets the CommandSendermessage()
Gets the message that will be returnedvoid
Sets the message that will be returnedvoid
setMessage
(@Nullable String message) Deprecated.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
UnknownCommandEvent
@Internal public UnknownCommandEvent(CommandSourceStack commandSource, String commandLine, @Nullable Component message)
-
-
Method Details
-
getSender
Gets the CommandSender- Returns:
- sender of the command
-
getCommandSource
Gets the command source associated with this event- Returns:
- the
CommandSourceStack
-
getCommandLine
Gets the command that was sent- Returns:
- command sent
-
getMessage
Deprecated.usemessage()
Gets the message that will be returned- Returns:
- unknown command message
-
setMessage
Deprecated.Sets the message that will be returnedSet to
null
to avoid any message being sent- Parameters:
message
- the message to be returned, ornull
-
message
Gets the message that will be returned- Returns:
- unknown command message
-
message
Sets the message that will be returnedSet to
null
to avoid any message being sent- Parameters:
message
- the message to be returned, ornull
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-
message()