Package org.bukkit.event.command

# Class UnknownCommandEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.command.UnknownCommandEvent

public class UnknownCommandEvent extends Event
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

Constructors
Constructor
Description
`UnknownCommandEvent(@NotNull CommandSender sender, @NotNull String commandLine, @Nullable String message)`
Deprecated.
`UnknownCommandEvent(@NotNull CommandSender sender, @NotNull String commandLine, @Nullable Component message)`

## Method Summary

Modifier and Type
Method
Description
`@NotNull String`
`getCommandLine()`
Gets the command that was send
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@Nullable String`
`getMessage()`
Deprecated.
use `message()`
`@NotNull CommandSender`
`getSender()`
Gets the CommandSender or ConsoleCommandSender
`@Nullable Component`
`message()`
Gets message that will be returned
`void`
`message(@Nullable Component message)`
Sets message that will be returned
`void`
`setMessage(@Nullable String message)`
Deprecated.
use `message(Component)`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### UnknownCommandEvent

@Deprecated public UnknownCommandEvent(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String commandLine, @Nullable @Nullable String message)
Deprecated.

### UnknownCommandEvent

public UnknownCommandEvent(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String commandLine, @Nullable @Nullable Component message)

## Method Details

### getSender

@NotNull public @NotNull CommandSender getSender()
Gets the CommandSender or ConsoleCommandSender

Returns:
  Sender of the command

### getCommandLine

@NotNull public @NotNull String getCommandLine()
Gets the command that was send

Returns:
  Command sent

### getMessage

@Nullable @Deprecated public @Nullable String getMessage()
Deprecated.
use `message()`
Gets message that will be returned

Returns:
  Unknown command message

### setMessage

@Deprecated public void setMessage(@Nullable @Nullable String message)
Deprecated.
use `message(Component)`
Sets message that will be returned

Set to null to avoid any message being sent

Parameters:
  `message` - the message to be returned, or null

### message

@Nullable public @Nullable Component message()
Gets message that will be returned

Returns:
  Unknown command message

### message

public void message(@Nullable @Nullable Component message)
Sets message that will be returned

Set to null to avoid any message being sent

Parameters:
  `message` - the message to be returned, or null

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()