Interface ArgumentCommand

All Known Implementing Classes:
TimingsCommand

public interface ArgumentCommand
An argument command is a command that uses CommandArgument as its arguments.
  • Method Details

    • getArguments

      List<CommandArgument<?>> getArguments()
      Gets the arguments of the command. This should be a list of arguments that do not change
      Returns:
      A list of command arguments
    • getDescription

      String getDescription()
      Gets a description of the command, designing to inform the user on what the command does.
      Returns:
      A string of the description
    • getPermissionNode

      Optional<Permission> getPermissionNode()
      Gets the permission node of the command that is required to run the command. If a permission is not required then this should return Optional.empty()

      When checking to see if this command has permission you should use hasPermission(CommandSource)

      Returns:
      The permission to the command
    • run

      boolean run(CommandContext commandContext, String... args) throws NotEnoughArguments
      Runs the command
      Parameters:
      commandContext - The command context for this command
      args - The arguments for the command
      Returns:
      if the command should show the usage (false to show)
      Throws:
      NotEnoughArguments - If the arguments provided are not enough for the command, this will throw
    • hasPermission

      default boolean hasPermission(CommandSource source)
      If the command source has permission to run this command
      Parameters:
      source - The command source to compare
      Returns:
      If the source has permission to run the command