AnnotatedCommandAPI

⭐ — (0 endorsements) 📥 63 downloads 📌 v1.2 📅 7/11/2025
🟠 Updated over a year ago

By ItsVaidas · library

⬇ Download Mod Source: Modrinth ↗ 📅 Updated: 7/5/2025 📅 Created: 7/11/2025

🔍 Analysis

  • 🏆 #7 of 20 library mods in this game by downloads

📋 About This Mod

# AnnotatedCommandAPI AnnotatedCommandAPI is a powerful, easy-to-use command framework designed to simplify Minecraft plugin command development by removing the complexity of Brigadier's command tree structure. It provides an intuitive annotation-based system that allows developers to define commands, subcommands, permissions, and argument parsing cleanly and efficiently within plain Java classes and methods. --- ## Key Features - **Annotation-Driven Commands**: Define commands and subcommands using straightforward annotations like `@Command` and `@Path`, eliminating verbose and error-prone boilerplate. - **Flexible Argument Parsing**: Supports primitive types (`String`, `int`, `double`, etc.) and advanced types (`World`, `Player`, custom objects) with automatic tab completion. - **Custom Argument Providers**: Easily create your own argument providers to supply dynamic command argument suggestions. - **Permission Integration**: Attach permissions at the command and subcommand level via annotations to control access seamlessly. - **Clear Separation**: Organize commands by class and group subcommands as annotated methods, making your codebase clean and maintainable. - **Player vs Console Execution**: Explicitly specify whether a command can be run by players, console, or both via method parameters (`Player` or `CommandSender`). --- ## Getting Started ### Integrating into your Plugin To use AnnotatedCommandAPI in your Minecraft plugin, add the following dependency to your `build.gradle` file: ```groovy repositories { maven { url 'https://jitpack.io' } } dependencies { implementation 'com.github.ItsVaidas:AnnotatedCommandAPI:TAG' } ``` Replace `TAG` with the latest version tag from the (https://github.com/ItsVaidas/AnnotatedCommandAPI) ### Basic Command Example Define a simple command that broadcasts a message to all players: ```java @Path( name = "<Message>", description = "Send message to the whole server" ) public void command(CommandSender sender, Sentence message) { Bukkit.getOnlinePlayers().forEach(p -> p.sendMessage(message.toString())); } ``` - The `@Path` annotation declares a command path with parameters. - `Sentence` is a special argument type designed to capture long strings including spaces. - For a single word argument, use `String`. --- ### Full Command Class with Subcommands A complex teleport command illustrating multiple subcommands and permissions: ```java @Command( name = "tpw", description = "World teleport command", permission = "zccommands.command.teleport" ) public class TpwCommand { @Path( name = "load <World>", description = "Load a world", permission = "zccommands.command.teleport.load" ) public void load(CommandSender sender, String world) { WorldCreator newWorld = new WorldCreator(world); newWorld.generator(new VoidChunkGenerator()); newWorld.createWorld(); } @Path( name = "unload <World>", description = "Unload a world", permission = "zccommands.command.teleport.unload" ) public void unload(CommandSender sender, String world) { Bukkit.unloadWorld(world, true); } @Path( name = "<World>", description = "Teleport to a world", permission = "zccommands.command.teleport.world" ) public void teleportToWorld(Player sender, World world) { sender.teleportAsync(world.getSpawnLocation()); } @Path( name = "<World> <X> <Y> <Z>", description = "Teleport to a world by coordinates", permission = "zccommands.command.teleport.world" ) public void teleportToWorldByCoordinates(Player sender, World world, double x, double y, double z) { sender.teleportAsync(new Location(world, x, y, z)); } } ``` ### Explanation: - The `@Command` annotation marks the class as a command root, setting its base name, description, and permission. - Each method annotated with `@Path` represents a subcommand or variant of the main command. - The `name` property of `@Path` defines the command syntax, including required parameters (e.g., `<World> <X> <Y> <Z>`). - Method parameters correspond to those command arguments, and their types can be native Java types or custom objects recognized by the system. - Permissions can be set per subcommand to fine-tune access control. - The first argument to every method is either a `Player` or `CommandSender`, depending on who can execute the command. --- ## Argument Types & Custom Providers AnnotatedCommandAPI supports: - **Primitive types**: `String`, `int`, `double`, `boolean`, etc. - **Complex types**: `Player`, `World`, `Location`, etc., with automatic tab-completion. - **Sentence**: A special argument type capturing entire sentences or multiple words with spaces. - **Custom argument providers**: To support dynamic or plugin-s

# AnnotatedCommandAPI

AnnotatedCommandAPI is a powerful, easy-to-use command framework designed to simplify Minecraft plugin command development by removing the complexity of Brigadier's command tree structure. It provides an intuitive annotation-based system that allows developers to define commands, subcommands, permissions, and argument parsing cleanly and efficiently within plain Java classes and methods.

## Key Features

  • Annotation-Driven Commands: Define commands and subcommands using straightforward annotations like `@Command` and `@Path`, eliminating verbose and error-prone boilerplate.
  • Flexible Argument Parsing: Supports primitive types (`String`, `int`, `double`, etc.) and advanced types (`World`, `Player`, custom objects) with automatic tab completion.
  • Custom Argument Providers: Easily create your own argument providers to supply dynamic command argument suggestions.
  • Permission Integration: Attach permissions at the command and subcommand level via annotations to control access seamlessly.
  • Clear Separation: Organize commands by class and group subcommands as annotated methods, making your codebase clean and maintainable.
  • Player vs Console Execution: Explicitly specify whether a command can be run by players, console, or both via method parameters (`Player` or `CommandSender`).

## Getting Started

### Integrating into your Plugin

To use AnnotatedCommandAPI in your Minecraft plugin, add the following dependency to your `build.gradle` file: ```groovy repositories { maven { url 'https://jitpack.io' } }

dependencies { implementation 'com.github. ItsVaidas:AnnotatedCommandAPI:TAG' } ```

Replace `TAG` with the latest version tag from the (https://github.com/ItsVaidas/AnnotatedCommandAPI)

### Basic Command Example

Define a simple command that broadcasts a message to all players:

```java @Path( name = "", description = "Send message to the whole server" ) public void command(CommandSender sender, Sentence message) { Bukkit.getOnlinePlayers().forEach(p -> p.sendMessage(message.toString())); } ```

  • The `@Path` annotation declares a command path with parameters.
  • `Sentence` is a special argument type designed to capture long strings including spaces.
  • For a single word argument, use `String`.

### Full Command Class with Subcommands

A complex teleport command illustrating multiple subcommands and permissions:

```java @Command( name = "tpw", description = "World teleport command", permission = "zccommands.command.teleport" ) public class TpwCommand {

@Path( name = "load ", description = "Load a world", permission = "zccommands.command.teleport.load" ) public void load(CommandSender sender, String world) { WorldCreator newWorld = new WorldCreator(world); newWorld.generator(new VoidChunkGenerator()); newWorld.createWorld(); }

@Path( name = "unload ", description = "Unload a world", permission = "zccommands.command.teleport.unload" ) public void unload(CommandSender sender, String world) { Bukkit.unloadWorld(world, true); }

@Path( name = "", description = "Teleport to a world", permission = "zccommands.command.teleport.world" ) public void teleportToWorld(Player sender, World world) { sender.teleportAsync(world.getSpawnLocation()); }

@Path( name = " ", description = "Teleport to a world by coordinates", permission = "zccommands.command.teleport.world" ) public void teleportToWorldByCoordinates(Player sender, World world, double x, double y, double z) { sender.teleportAsync(new Location(world, x, y, z)); } } ```

### Explanation:

  • The `@Command` annotation marks the class as a command root, setting its base name, description, and permission.
  • Each method annotated with `@Path` represents a subcommand or variant of the main command.
  • The `name` property of `@Path` defines the command syntax, including required parameters (e.g., ` `).
  • Method parameters correspond to those command arguments, and their types can be native Java types or custom objects recognized by the system.
  • Permissions can be set per subcommand to fine-tune access control.
  • The first argument to every method is either a `Player` or `CommandSender`, depending on who can execute the command.

## Argument Types & Custom Providers

AnnotatedCommandAPI supports:

  • Primitive types: `String`, `int`, `double`, `boolean`, etc.
  • Complex types: `Player`, `World`, `Location`, etc., with automatic tab-completion.
  • Sentence: A special argument type capturing entire sentences or multiple words with spaces.
  • Custom argument providers: To support dynamic or plugin-s
🤖 AI-enhanced — based on mod data

📊 Mod Details

Game
Minecraft Plugins
Author
ItsVaidas
Version
1.2
Downloads
63
Endorsements
0
Category
library
Created
7/11/2025
Updated
7/5/2025
Game Versions
1.21.7
Tags
library, utility

🔧 How to Install Minecraft Plugins Mods

Download from Modrinth. Use Prism Launcher or drop into your mods folder.

📖 Full step-by-step install guide for Minecraft Plugins →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Plugins commands, item IDs, and more.

❓ Frequently Asked Questions

Which Minecraft Plugins versions does AnnotatedCommandAPI support?

The author lists 1.21.7. Other versions may work but are untested by the author.

What is the latest version of AnnotatedCommandAPI?

Version 1.2, published 2025-07-05 with 63 downloads recorded at the source.

Keep browsing — more Minecraft Plugins mods await

📋 All Minecraft Plugins Mods 🏆 Top 25 📂 More library 👤 More by ItsVaidas 🔎 Similar Mods 🌐 Best library (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods