Skip to content

jonagamerpro1234/CommandAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CommandAPI

Ask DeepWiki

A flexible Bukkit/Spigot command system with built-in subcommands, permissions, and tab completion.

Features

Define a main command with optional custom logic.

Add subcommands with their own permissions, console rules, and tab completion.

Automatic tab suggestions for main commands and subcommands.

Easy registration via your JavaPlugin.

Quick Example

new BaseCommand() {
    {
        name("mycommand")
        .addSubCommand(new HelpSubCommand())
        .addSubCommand(new ReloadSubCommand());
    }

    @Override
    public boolean onCommandMain(CommandSender sender, String[] args) {
        sender.sendMessage("Use /mycommand help to see available commands!");
        return true;
    }

    @Override
    public List<String> onTabMain(CommandSender sender, String[] args) {
        return Arrays.asList("option1", "option2");
    }
}.register(this); // automatically registers the command

How it works

/mycommand → runs onCommandMain.

/mycommand help → runs HelpSubCommand.

Tab completion works automatically for both main command and subcommands.

Each subcommand can define permissions, console access, and custom tab lists.

##Maven

<dependency>
  <groupId>jss.commandapi</groupId>
  <artifactId>command-api</artifactId>
  <version>0.0.8-alpha</version>
</dependency>

Gradle (Groovy DSL)

dependencies {
    implementation 'jss.commandapi:command-api:0.0.8-alpha'
}

Gradle (Kotlin DSL)

dependencies {
    implementation("jss.commandapi:command-api:0.0.8-alpha")
}

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •  

Languages