Class SubCommand
java.lang.Object
com.andrei1058.bedwars.api.command.SubCommand
-
Constructor Summary
ConstructorDescriptionSubCommand
(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 TypeMethodDescriptionboolean
Check if a sender can see/ use the sub cmdabstract boolean
Add your sub-command code under this methodnet.md_5.bungee.api.chat.TextComponent
Get command description for subCommands listGet parent commandint
Get show priorityGet sub-command nameManage sub-command tab completeboolean
hasPermission
(org.bukkit.command.CommandSender p) Check if player has permission to use the commandboolean
Check if it is an arena setup commandboolean
isShow()
Check if is displayed on the listvoid
setArenaSetupCommand
(boolean arenaSetupCommand) True if it is an arena setup sub-commandvoid
setDisplayInfo
(net.md_5.bungee.api.chat.TextComponent displayInfo) This is the command information in the subCommands list of the target parentvoid
setPermission
(String permission) Set permission for sub-commandvoid
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 firstvoid
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
-
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
-