SmartCommand

This is a guide to learn how to use the SmartCommand class.

What is SmartCommand ?

SmartCommand is a class used to store our command data. You can get it in the parameters of the methods of the CommandExecutor interface or by using the getSmartCommand(String name) method from the SmartCommandsManager class.

Available methods

Here are the available methods of the SmartCommand class:

General

Method

Type

Description

getName()

String

Get the name of the command

getDescription()

String

Get the description of the command

getUsage()

String

Get the usage of the command

getAliases()

List<String>

Get the aliases of the command

getIssuers()

List<IssuerType>

Get the types of users who can execute the command

canExecute(IssuerType type)

boolean

True is the IssuerType can execute the command or else false

useTabCompleter()

boolean

True if you're using the automatic tab completor or else false

Command contents

Method

Type

Description

getResourcePath()

String

Get the resource path of the command contents file

hasResourcePath()

boolean

True if the command has a contents file or else false

isResourceOnly()

boolean

True if the command contents file must not be created on the server or else false

getCommandContents()

CommandContents

Get the class which stores the contents of the command (see here for more information)

CommandExecutor

Method

Type

Description

setExecutor(CommandExecutor executor)

void

Set a CommandExecutor to the command

getExecutor()

CommandExecutor

Get the CommandExecutor of the command

Completions

Click on the link below for more information.

Automatic tab completor

Last updated