Class InvalidCommandSenderException

All Implemented Interfaces:
Serializable

public final class InvalidCommandSenderException extends CommandParseException
Exception thrown when an invalid command sender tries to execute a command
See Also:
Serialized Form
  • Constructor Details

    • InvalidCommandSenderException

      public InvalidCommandSenderException(@NonNull Object commandSender, @NonNull Class<?> requiredSender, @NonNull List<@NonNull CommandArgument<?,​?>> currentChain)
      Construct a new command parse exception
      Parameters:
      commandSender - Sender who executed the command
      requiredSender - The sender type that is required
      currentChain - Chain leading up to the exception
    • InvalidCommandSenderException

      public InvalidCommandSenderException(@NonNull Object commandSender, @NonNull Class<?> requiredSender, @NonNull List<@NonNull CommandArgument<?,​?>> currentChain, @Nullable Command<?> command)
      Construct a new command parse exception
      Parameters:
      commandSender - Sender who executed the command
      requiredSender - The sender type that is required
      currentChain - Chain leading up to the exception
      command - Command
      Since:
      1.4.0
  • Method Details

    • getRequiredSender

      public @NonNull Class<?> getRequiredSender()
      Get the required sender type
      Returns:
      Required sender type
    • getMessage

      public String getMessage()
      Overrides:
      getMessage in class Throwable
    • getCommand

      public @Nullable Command<?> getCommand()
      Get the Command which the sender is invalid for
      Returns:
      Command
      Since:
      1.4.0