Class SubCommand
java.lang.Object
com.andrei1058.bedwars.api.command.SubCommand
-
Constructor Summary
ConstructorsConstructorDescriptionSubCommand(ParentCommand parent, String name) Create a sub-command for a bedWars command Make sure you return true or it will say command not found -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if a sender can see/ use the sub cmdabstract booleanAdd your sub-command code under this methodnet.md_5.bungee.api.chat.TextComponentGet command description for subCommands listGet parent commandintGet show priorityGet sub-command nameManage sub-command tab completebooleanhasPermission(org.bukkit.command.CommandSender p) Check if player has permission to use the commandbooleanCheck if it is an arena setup commandbooleanisShow()Check if is displayed on the listvoidsetArenaSetupCommand(boolean arenaSetupCommand) True if it is an arena setup sub-commandvoidsetDisplayInfo(net.md_5.bungee.api.chat.TextComponent displayInfo) This is the command information in the subCommands list of the target parentvoidsetPermission(String permission) Set permission for sub-commandvoidsetPriority(int priority) This is the command priority in the sub-commands list You may use this method if you set showInList true Commands with a minor number will be displayed firstvoidshowInList(boolean value) Display the sub-command under the main command Don't forget to set the displayInfo Ops only will see it cuz players receive a commands list from messages file
-
Constructor Details
-
SubCommand
Create a sub-command for a bedWars command Make sure you return true or it will say command not found- Parameters:
parent- parent commandname- sub-command name
-
-
Method Details
-
execute
Add your sub-command code under this method -
getSubCommandName
Get sub-command name -
showInList
public void showInList(boolean value) Display the sub-command under the main command Don't forget to set the displayInfo Ops only will see it cuz players receive a commands list from messages file -
setDisplayInfo
public void setDisplayInfo(net.md_5.bungee.api.chat.TextComponent displayInfo) This is the command information in the subCommands list of the target parent -
setPriority
public void setPriority(int priority) This is the command priority in the sub-commands list You may use this method if you set showInList true Commands with a minor number will be displayed first -
getParent
Get parent command -
getPriority
public int getPriority()Get show priority -
getDisplayInfo
public net.md_5.bungee.api.chat.TextComponent getDisplayInfo()Get command description for subCommands list -
setArenaSetupCommand
public void setArenaSetupCommand(boolean arenaSetupCommand) True if it is an arena setup sub-command -
isArenaSetupCommand
public boolean isArenaSetupCommand()Check if it is an arena setup command -
isShow
public boolean isShow()Check if is displayed on the list -
setPermission
Set permission for sub-command -
hasPermission
public boolean hasPermission(org.bukkit.command.CommandSender p) Check if player has permission to use the command -
canSee
Check if a sender can see/ use the sub cmd- Parameters:
api- BedWars api instance
-
getTabComplete
Manage sub-command tab complete
-