AnnoLib
Annotation-driven registration and datagen for NeoForge 1.21.1.
AnnoLib is a developer-focused library that reduces boilerplate by letting mods declare content and runtime behavior directly with annotations. Write an annotation, and AnnoLib handles registration, generated resources, or the corresponding NeoForge integration.
Why AnnoLib?
- Less boilerplate: register items, blocks, entities, and other entries with
@Register. - Built-in datagen: generate language files, item/block models, blockstates, tags, recipes, and data maps.
- Runtime integrations: commands, key mappings, configs, network packets, spawn eggs, and item customization.
- Stable extension points: registration hooks and safe factories without replacing registry objects.
- Works with existing content: modify vanilla or modded items through NeoForge events.
Features
@Registerwith registry inference, automatic BlockItems, creative tabs, and safe object factories@Translation,@Model,@Tag,@ShapedRecipe,@ShapelessRecipe@SpawnEgg@Fuel,@Compostable,@Flammable@Command,@KeyMapping,@Config@Packet/@PacketHandler@Interceptregistration before/after hooks@ItemAttributesand@ItemComponentsfor vanilla and modded items- API/implementation split:
annolib-apifor compilation,annolibfor runtime
Requirements
- Minecraft 1.21.1
- NeoForge 21.1.222+
- Java 21
- ScannerLib 1.1.0+ installed at runtime
Installation
Place both jars in your mods folder:
mods/
├── annolib-1.2.0.jar
└── scannerlib-neoforge-1.1.0.jar
annolib-api-1.2.0.jar is an optional compile-time artifact and must not be installed as a mod.
For Developers
Add AnnoLib as a dependency and write annotated entries:
@Register("ruby")
@Translation(en = "Ruby", zhCn = "红宝石")
public static final Item RUBY = new Item(new Item.Properties());
AnnoLib processes the entry during startup and registers it as your_mod_id:ruby.
See the README for the full annotation reference, examples, and datagen setup.
Current Scope
Fabric support is not included in this release. Entity renderers, entity attributes, loot tables, and global Mixin interception are also outside the current scope.
Links
License
MIT