Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Using ACF - Annotation Command Framework
Build Tool Setup
Getting a Command Manager
This part is platform specific. Use the command manager that represents your platform.
BukkitCommandManager manager = new BukkitCommandManager(yourBukkitPlugin);
Paper (Recommended over Bukkit):
- Using the Paper Command Manager does NOT make your plugin require Paper. It simply lets it take advantage of Paper specific features if available, such as Asynchronous Tab Completions
- Paper specific improvements will be added in the future as potential is found.
- Server owners are STRONGLY encouraged to use Paper instead of Spigot or CraftBukkit, as it is a massive improvement to the server software.
PaperCommandManager manager = new PaperCommandManager(yourBukkitPlugin);
BungeeCommandManager manager = new BungeeCommandManager(yourBungeePlugin);
SpongeCommandManager manager = new SpongeCommandManager(yourSpongePlugin);
Registering a command
First you need to create a class that extends
BaseCommand, then register that command with the manager
If you need your plugin instance, pass it to your commands constructor like so (this is called dependency injection if you are not aware)
See Wiki Home for links to the other guides, but here is some important ones: