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
- Since:
- 1.12
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionUnknownCommandEvent(CommandSourceStack commandSource, String commandLine, @Nullable net.kyori.adventure.text.Component message) -
Method Summary
Modifier and TypeMethodDescriptionGets the command that was sentGets the command source associated with this eventstatic HandlerList@Nullable StringDeprecated.Gets the CommandSender@Nullable net.kyori.adventure.text.Componentmessage()Gets the message that will be returnedvoidmessage(@Nullable net.kyori.adventure.text.Component message) Sets the message that will be returnedvoidsetMessage(@Nullable String message) Deprecated.Methods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
UnknownCommandEvent
@Internal public UnknownCommandEvent(CommandSourceStack commandSource, String commandLine, @Nullable net.kyori.adventure.text.Component message)
-
-
Method Details
-
getSender
-
getCommandSource
Gets the command source associated with this event- Returns:
- the
CommandSourceStack - Since:
- 1.21.10
-
getCommandLine
-
getMessage
Deprecated.usemessage()Gets the message that will be returned- Returns:
- unknown command message
- Since:
- 1.12
-
setMessage
Deprecated.Sets the message that will be returnedSet to
nullto avoid any message being sent- Parameters:
message- the message to be returned, ornull- Since:
- 1.12
-
message
@Contract(pure=true) public @Nullable net.kyori.adventure.text.Component message()Gets the message that will be returned- Returns:
- unknown command message
- Since:
- 1.16.5
-
message
public void message(@Nullable net.kyori.adventure.text.Component message) Sets the message that will be returnedSet to
nullto avoid any message being sent- Parameters:
message- the message to be returned, ornull- Since:
- 1.16.5
-
getHandlers
- Specified by:
getHandlersin classEvent- Since:
- 1.12
-
getHandlerList
- Since:
- 1.12
-
message()