Skip to content

Makes Minecraft command listener looks better and developer-friendly.

License

Notifications You must be signed in to change notification settings

Yellowstrawberrys/Commander

Repository files navigation

Commander

Makes Minecraft command more developer-friendly.


Use

Warning

This library only works with Paper & Folia

You can implement this library with

Gradle

repositories {
    maven {
        name = "roinSnapshots"
        url = uri("https://repo.roinz.xyz/snapshots")
    }
}

dependencies {
    implementation "xyz.yellowstrawberry:Commander:1.0.3-SNAPSHOT"
}

Maven

<repositories>
    <repository>
        <id>roin-snapshots</id>
        <name>Roin Repository</name>
        <url>https://repo.roinz.xyz/snapshots</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>xyz.yellowstrawberry</groupId>
        <artifactId>Commander</artifactId>
        <version>1.0.3-SNAPSHOT</version>
    </dependency>
</dependencies>

Code Example

YourPlugin.java

public class YourPlugin extends JavaPlugin {
    Commander commander = new Commander(this);
    
    public void onEnable() {
        commander.registerCommands(new CustomCommand());
    }
    
    // ...
}

CustomCommand

@Command("hello")
public class CustomCommand {

    @CommandListener(target = CommandTarget.PLAYER)
    public Component execute() {
        return Component.text("Hello, Commander!");
    }

    @SubCommand("world")
    public Component subcommand() {
        return Component.text("Hello, World!");
    }
    
    // ...
}

Releases

No releases published

Packages

No packages published

Languages