HomeJavaModsEdenCommands
Code (Java):
class MyClass {
    public MyClass ( ) {
        //creating a command node
        CommandNode node = LiteralCommandNode. literal ( "mycommand" ) ;
        node. executes (context -> { } ) ;
        node. withPermission ( "myplugin.mycommand" ) ;
       
        //adding a subcommand -> /mycommand subcommand
        node. then (LiteralCommandNode. literal ( "subcommand" ) ) ;
       
        //register it
        CommandRegistry. register (node ) ;
    }
}
Code (Java):
class MyClass {
    public MyClass ( ) {
        CommandNode node = LiteralCommandNode. literal ( "mycommand" ) ;
        CommandNode argument = ArgumentCommandNode ( "key", IntegerArgumentParser. intParser ( 0, 10 ) ) ;
        argument. executes (context -> {
            int number = context. getParameter ( "key", Integer. class ) ;
            context. getSender ( ). sendMessage (number ) ;
        } ) ;
        node. then (argument ) ;
    }
}
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

EdenCommands is a free Minecraft Java mod. Compatible with Minecraft 1.17, 1.18. Downloaded 79 times (via Spigot). Download it and open it directly in the game.

Explore more