Skip to content

Hey there! If you like my work, you can support me by sponsoring me on GitHub. Thanks! ❤

Sponsor me
on GitHub

@Arg

To define argument's parsing and suggestions, you need to use @Arg annotation.

java
@Command(name = "say")
public class SayCommand {
    @Execute
    void execute(@Context SENDER sender, @Arg String text) {
        System.out.println(text);
    }
}

Types

If you want to automatically parse the argument to a specific type, then change the type of the argument to one of the supported types or create your own.

java
@Command(name = "time set")
public class TimeSetCommand {
    @Execute
    void execute(@Context SENDER sender, @Arg int time) {
        sender.sendMessage("Time set to " + time);
    }
}

Made by LiteDevelopers and Contributors with ❤️