Interface SubCommand
- All Known Subinterfaces:
- CommandsCollection
 Basically anything you're able to give a name is a command.
 This also includes a collection of commands (e.g. /bw or /bw arena).
 Those collections are being implemented by CommandsCollection and are also executable.
- 
Method SummaryModifier and TypeMethodDescriptionString[]Other possible names for accessing this command.default StringgetFullName(String label) Returns the "full name" as if you'd type it in.The handler handles what should happen when the command is e.g. getting executedgetName()The main name of the command, which will be displayed in e.g.@Nullable CommandsCollectionA command must be added into a collection otherwise it's not accessible.@Nullable StringThe permission needed to use the command.default StringgetUsage()Returns the default parameters the command expects.getUsage(@Nullable CommandSenderWrapper senderWrapper) Returns the parameters the command expects for a specific sender.booleanReturns whether or not it'll display the amount of entries in /bw [...] help.booleanWhether or not only players are able to execute the commandbooleanReturns whether or not this command is visible in help.voidsetAliases(String... aliases) Set the new aliases of the command.voidsetHandler(CommandHandler handler) The handler handles what should happen when the command is e.g. getting executedvoidsetHasContentAmount(boolean hasContentAmount) Set whether or not it'll display the amount of entries in /bw [...] help.voidsetOnlyForPlayers(boolean onlyForPlayers) Whether or not only players are able to execute the commandvoidsetPermission(@Nullable String permission) The permission needed to use the command.voidSet the parameters the command expectsvoidsetVisible(boolean visible) Set whether or not this command is visible in help.
- 
Method Details- 
getNameString getName()The main name of the command, which will be displayed in e.g. /bw help.Example: If this returns "banana" then you'd have to type in /bw banana. - Returns:
- The name of the command
 
- 
getParentA command must be added into a collection otherwise it's not accessible.As the system is built in a tree-structure-way each command must have a parent node/command. There's only one instance that doesn't have a parent and that's the root node which you obtain with BedwarsAPI.getRootCommandsCollection().- Returns:
- The parent collection to which this command has been added to
 
- 
getFullNameReturns the "full name" as if you'd type it in.E.g. it returns "/bw arena banana" where "bw" is the label which you pass in as a parameter. - Parameters:
- label- The actual command you'd use to access the command (e.g. "bw")
- Returns:
- The full command name
 
- 
getAliasesString[] getAliases()Other possible names for accessing this command.Keep in mind that it's possible that aliases overlap themselves and there's no guarantee that this one will be executed if this occurs. Names of a command have a higher priority than aliases. These won't be shown in /bw help - Returns:
- Aliases of the command
 
- 
setAliasesSet the new aliases of the command. You don't have to include the name of the command in the array.Keep in mind that it's possible that aliases overlap themselves and there's no guarantee that this one will be executed if this occurs. Names of a command have a higher priority than aliases. These won't be shown in /bw help - Parameters:
- aliases- The new aliases of the command
 
- 
getPermissionThe permission needed to use the command. Sender will see an error if he does not have the permission and the execution won't be passed to the handler.nullmeans that no permission is needed to run the command- Returns:
- The permission needed to execute the command. nullmeaning that none is needed
 
- 
setPermissionThe permission needed to use the command. Sender will see an error if he does not have the permission and the execution won't be passed to the handler.nullmeans that no permission is needed to run the command- Parameters:
- permission- The new permission needed to execute the command.- nullmeaning that none is needed
 
- 
getUsageReturns the default parameters the command expects.Use <> for parameters that are strictly needed, [] for optional ones. 
 Example: /teleport <target> [source]
 We must add a target parameter, but we are not forced to add a source parameter.
 This example would return with this method ">target< [source]"- Returns:
- The usage of the command
 
- 
getUsageReturns the parameters the command expects for a specific sender.By default if no sender is being passed, the same usage that has been defined using setUsage(String). However, you may also add conditional usages by overridingCommandHandler.getContentAmount(CommandSender).- Parameters:
- senderWrapper- The sender we are getting the usage for. Maybe be- nullif we want to use the default usage
- Returns:
- The usage of the command
 
- 
setUsageSet the parameters the command expectsUse <> for parameters that are strictly needed, [] for optional ones. 
 Example: /teleport <target> [source]
 We must add a target parameter, but we are not forced to add a source parameter.
 This example would return with this method ">target< [source]"- Parameters:
- usage- The new usage of the command
 
- 
getHandlerCommandHandler getHandler()The handler handles what should happen when the command is e.g. getting executed- Returns:
- The handler of the command
 
- 
setHandlerThe handler handles what should happen when the command is e.g. getting executed- Parameters:
- handler- The new handler of this command
 
- 
isOnlyForPlayersboolean isOnlyForPlayers()Whether or not only players are able to execute the command- Returns:
- If the command is only for normal players and not for the console
 
- 
setOnlyForPlayersvoid setOnlyForPlayers(boolean onlyForPlayers) Whether or not only players are able to execute the command- Parameters:
- onlyForPlayers- The new value
 
- 
isVisibleboolean isVisible()Returns whether or not this command is visible in help.Interesting for debug or hidden commands which shouldn't be shown to normal players - Returns:
- Whether or not the command is visible in /bw [...] help
 
- 
setVisiblevoid setVisible(boolean visible) Set whether or not this command is visible in help.Interesting for debug or hidden commands which shouldn't be shown to normal players - Parameters:
- visible- The new value
 
- 
hasContentAmountboolean hasContentAmount()Returns whether or not it'll display the amount of entries in /bw [...] help.The amount is getting fetched by the current handler using CommandHandler.getContentAmount(org.bukkit.command.CommandSender)- Returns:
- If it'll display the amount of content or entries in /bw [...] help
 
- 
setHasContentAmountvoid setHasContentAmount(boolean hasContentAmount) Set whether or not it'll display the amount of entries in /bw [...] help.The amount is getting fetched by the current handler using CommandHandler.getContentAmount(org.bukkit.command.CommandSender)- Parameters:
- hasContentAmount- New value
 
 
-