Class SubCommand

java.lang.Object
com.andrei1058.bedwars.api.command.SubCommand

public abstract class SubCommand extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Create a sub-command for a bedWars command Make sure you return true or it will say command not found
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canSee(org.bukkit.command.CommandSender sender, BedWars api)
    Check if a sender can see/ use the sub cmd
    abstract boolean
    execute(String[] args, org.bukkit.command.CommandSender s)
    Add your sub-command code under this method
    net.md_5.bungee.api.chat.TextComponent
    Get command description for subCommands list
    Get parent command
    int
    Get show priority
    Get sub-command name
    abstract List<String>
    Manage sub-command tab complete
    boolean
    hasPermission(org.bukkit.command.CommandSender p)
    Check if player has permission to use the command
    boolean
    Check if it is an arena setup command
    boolean
    Check if is displayed on the list
    void
    setArenaSetupCommand(boolean arenaSetupCommand)
    True if it is an arena setup sub-command
    void
    setDisplayInfo(net.md_5.bungee.api.chat.TextComponent displayInfo)
    This is the command information in the subCommands list of the target parent
    void
    setPermission(String permission)
    Set permission for sub-command
    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
    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SubCommand

      public SubCommand(ParentCommand parent, String name)
      Create a sub-command for a bedWars command Make sure you return true or it will say command not found
      Parameters:
      name - sub-command name
      parent - parent command
  • Method Details

    • execute

      public abstract boolean execute(String[] args, org.bukkit.command.CommandSender s)
      Add your sub-command code under this method
    • getSubCommandName

      public String 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

      public ParentCommand 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

      public void setPermission(String permission)
      Set permission for sub-command
    • hasPermission

      public boolean hasPermission(org.bukkit.command.CommandSender p)
      Check if player has permission to use the command
    • canSee

      public boolean canSee(org.bukkit.command.CommandSender sender, BedWars api)
      Check if a sender can see/ use the sub cmd
      Parameters:
      api - BedWars api instance
    • getTabComplete

      public abstract List<String> getTabComplete()
      Manage sub-command tab complete