Class UnknownCommandEvent

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

@NullMarked public class UnknownCommandEvent extends Event
Thrown when a player executes a command that is not defined
  • Constructor Details

  • Method Details

    • getSender

      public CommandSender getSender()
      Gets the CommandSender or ConsoleCommandSender
      Returns:
      Sender of the command
    • getCommandLine

      public String getCommandLine()
      Gets the command that was sent
      Returns:
      Command sent
    • getMessage

      @Deprecated public @Nullable String getMessage()
      Deprecated.
      Gets message that will be returned
      Returns:
      Unknown command message
    • setMessage

      @Deprecated public void setMessage(@Nullable String message)
      Deprecated.
      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

      @Contract(pure=true) public @Nullable Component message()
      Gets message that will be returned
      Returns:
      Unknown command message
    • message

      public void message(@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

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()