/LiteCommands

☄️ LiteCommands - Annotation based Command framework for Velocity, Bukkit, Paper, BungeeCord, Minestom and your other implementations.

Primary LanguageJavaApache License 2.0Apache-2.0

hacktoberfest

LiteCommands & Hacktoberfest 2023

Register on hacktoberfest.com and start supporting open source!
Add/Improve/Fix features and open Pull request! If you don't have an idea, see issues!

banner

☄️ LiteCommands dependency Donate Discord

Command framework for Velocity, Bukkit, Paper, BungeeCord, Minestom, JDA and your other implementations.

Helpful links:

Panda Repository (Maven or Gradle) ❤️

<repository>
    <id>panda-repository</id>
    <url>https://repo.panda-lang.org/releases</url>
</repository>
maven { url "https://repo.panda-lang.org/releases" }

Dependencies (Maven or Gradle)

Framework Core

<dependency>
    <groupId>dev.rollczi</groupId>
    <artifactId>litecommands-core</artifactId>
    <version>3.0.0-BETA-pre22</version>
</dependency>
implementation 'dev.rollczi:litecommands-core:3.0.0-BETA-pre22'

First Simple Command

/hello-world <name> <amount>
/hello-world message <text...>

@Command(name = "hello-world")
@Permission("dev.rollczi.helloworld")
public class HelloWorldCommand {

    @Execute
    public void command(@Context CommandSender sender, @Arg String name, @Arg int amount) {
        for (int i = 0; i < amount; i++) {
            sender.sendMessage("Hello " + name);
        }
    }
    
    @Execute(name = "message")
    public void subcommand(@Context CommandSender sender, @Join String text) {
        sender.sendMessage(text);
    }

}

Register your first command in plugin main class: (in this case for Velocity)

this.liteCommands=LiteVelocityFactory.builder(proxy)
    .command(HelloWorldCommand.class)
    .register();

Velocity Extension Dependencies (Maven or Gradle)

Add this to your dependencies if you want to use ready-made implementation for velocity.

<dependency>
    <groupId>dev.rollczi</groupId>
    <artifactId>litecommands-velocity</artifactId>
    <version>3.0.0-BETA-pre22</version>
</dependency>
implementation 'dev.rollczi:litecommands-velocity:3.0.0-BETA-pre22'

Add -parameters to your compiler to use all features of LiteCommands

tasks.withType(JavaCompile) {
    options.compilerArgs << "-parameters"
}
tasks.withType<JavaCompile> {
    options.compilerArgs.add("-parameters")
}
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.8.1</version>
  <configuration>
    <compilerArgs>
      <arg>-parameters</arg>
    </compilerArgs>
  </configuration>
</plugin>

All extensions:

Other examples:

See (Important dependencies used)

Plugins that use LiteCommands: