[Paper] Your First Command
Learn how to create a simple hello world plugin with Enchanted and the Paper API.
Prerequisites
Creating the Command
Every command must be annotated with @Command
. If you get an error, double check that you didn't accidentally use net.jailgens.enchanted.Command
.
If you have typed the command name in incorrectly, you should get a warning inside your IDE.
Now, simply create a method annotated with @Command.Default
and inside print "Hello, world!"
All @Command.Default
tells enchanted is that the annotated method should run when the user executes the "hello-world" command without specifying any subcommand.
Register the Command
Command registration is fairly simple, just call CommandManager.registerCommand(Object)
with the command you just created:
Now, simply start up your server, and see the output on console.
Last updated