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 ) ;
}
}
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 ) ;
}
}
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
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.17, 1.18
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
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.