HammerLib
by Zeith
HammerLib is a Forge and NeoForge library by Zeith that supplies shared code other mods build on, including registration, networking and NBT helpers for mod developers.
What it does
Content registration is handled through annotations, so blocks and items can be declared in code without long manual setup. For block entities, a custom BlockEntityType constant may carry an additional @TileRenderer annotation that points to an IBESR class matching the tile.
Recipes and block tags can be populated from Java. A RegisterRecipesEvent and a BuildTagsEvent both run on the HammerLib event bus, so crafting recipes and tag contents are written as code rather than data files. Block harvesting is handled through BlockHarvestAdapter wrappers, which follow the tag-based harvesting system.
Networking uses a Network class together with IPacket and INBTPacket interfaces, and serialization is field-based, so NBT read and write code is generated from the fields a class declares.
Key features
Annotation-based registration
Content is registered through annotations, reducing the setup code a developer writes for each block and item.
Block entity rendering hook
A @TileRenderer annotation on a custom BlockEntityType constant links the type to its renderer class.
Event-driven recipes and tags
RegisterRecipesEvent and BuildTagsEvent let crafting recipes and block tags be defined in Java on the event bus.
Simplified packet code
The Network class with IPacket and INBTPacket provides a compact way to write and send network packets.
Field-based NBT serialization
Fields marked for serialization are written and read automatically, so separate serialization code is not needed.
Gallery
Compatibility
Latest build for each game version and loader.
1.21.x3 of 3 versions with builds
1.20.x7 of 7 versions with builds
1.19.x2 of 2 versions with builds
1.18.x2 of 2 versions with builds
1.16.x2 of 2 versions with builds
1.15.x1 of 1 version with builds
1.13.x1 of 1 version with builds
1.12.x1 of 1 version with builds
1.11.x2 of 2 versions with builds
1.10.x1 of 1 version with builds
Only full game releases are shown. This mod publishes no snapshot builds.
Required by 23 mods
Use cases
Building a mod on HammerLib
Developers use the registration, networking and serialization helpers as a base for their own content.
Who it’s for: Mod developers building on Forge or NeoForge, and players who install one of the catalog mods that depend on HammerLib.
How it compares
Lib 39 covers Fabric, Forge and NeoForge for 1.20.1 – 1.21.11 under the MIT License, and it is open source. Kinecraft is also open source under the MIT License, with files for Fabric, Forge, NeoForge and Quilt across 1.16.5 – 1.21.5, and it works on either client or server, and neither needs it. HammerLib is not open source and is limited to Forge and NeoForge, so it does not cover Fabric or Quilt.
Questions
Does Improvable Skills need HammerLib?
Does HammerLib have to be installed on the server?
Which loaders does HammerLib support?
In the catalog
HammerLib is one of 3,514 Library mods on ModsFinder, and one of 1,576 Library mods for Forge. 17,979 mods support Minecraft 1.21.4.
More from Zeith
Similar mods
What the author says
Utility mod that contains really useful code for quite a few mods. Simple, annotation-based content registration. For Blocks, HammerLib automagically registers BlockItem(s). If you want to disable BlockItem(s), let your block implement INoItemBlock, ICustomBlockItem, or ICreativeTabBlock, depending on what you want…
Official listing
- Modrinth page
- modrinth.com/mod/hammer-lib
- Owner
- Zeith
- Published
- 2023-05-14
- Updated on Modrinth
- 2026-09-25
- Facts verified
- 2026-10-15
