Class SimpleCommand

java.lang.Object
net.minestom.server.command.builder.Command
net.minestom.server.command.builder.SimpleCommand

public abstract class SimpleCommand extends Command
  • Constructor Details

    • SimpleCommand

      public SimpleCommand(@NotNull @NotNull String name, @Nullable @Nullable String... aliases)
  • Method Details

    • process

      public abstract boolean process(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String command, @NotNull @NotNull String[] args)
      Called when the command is executed by a CommandSender.
      Parameters:
      sender - the sender which executed the command
      command - the command name used
      args - an array containing all the args (split by space char)
      Returns:
      true when the command is successful, false otherwise
    • hasAccess

      public abstract boolean hasAccess(@NotNull @NotNull CommandSender sender, @Nullable @Nullable String commandString)
      Called to know if a player has access to the command.
      Parameters:
      sender - the command sender to check the access
      commandString - the raw command string, null if this is an access request
      Returns:
      true if the player has access to the command, false otherwise