HookLib
by hohserg
HookLib is a Forge library for 1.12.2 that lets developers inject code into Minecraft and other mods through coremods, without writing bytecode by hand.
What it does
Developers use HookLib to write Forge coremods that attach their own methods to existing game code. The library finds a target method by name and argument types, inserts a call to a hook class at the start of it, and reports the match in the console. Injection points can target a method call or an expression, and the library can pass local variables from the target method into the hook. Access to private fields and methods is also covered, so a hook can read or change values the original code keeps hidden.
HookLib is loaded as a coremod. Players of a modpack do not use it directly, since it has no items or blocks. It is required by 1 other catalog mod, DimensionalLayers, and it runs on the client, the server or both, as the environment is optional on either side. The code is open source under the MIT License, and the project has a wiki with API details and advanced techniques. Files exist only for Forge 1.12.2, with build 3.28 dated 2026-02-11 as the latest.
Key features
Coremod framework
A framework for building Forge coremods that change game classes at load time, with a startup option for loading its main loader.
Method and expression injection
Injection points can target a method call or an expression, so hook code runs at a chosen place inside the original method.
Local variable access
Hooks can receive the local variables of the target method as arguments, which makes the library useful for reading intermediate values.
Private member access
Private variables and methods of Minecraft classes can be reached from hook code, which the library handles for the developer.
Compatibility
Latest build for each game version and loader.
Only full game releases are shown. This mod publishes no snapshot builds.
Required by 1 mod
How it compares
MixinConBooter is open source under the MIT License, covers 1.6.1 – 1.12.2 and has the same optional environment, so it fits the same era of Forge development. ConfigAnytime is also open source under the MIT License, but it is a client and server mod for 1.12.2 that changes configuration rather than injecting code. LMCommonCore is a different kind of library, licensed under the GNU General Public License v3.0 only and published for Fabric, Forge and NeoForge for 1.20.1 – 1.21.1, where HookLib covers only Forge 1.12.2.
| Mod | Loaders | Game versions | Environment | Updated |
|---|---|---|---|---|
| HookLib | Forge | 1.12.2 | Client or server, optional | 2026-02-11 |
| MixinConBooter | Forge | 1.6.1 – 1.12.2 | Client or server, optional | 2025-09-26 |
| ConfigAnytime | Forge | 1.12.2 | Client and server | 2024-03-26 |
| LMCommonCore | Fabric, Forge and NeoForge | 1.20.1 – 1.21.1 | Client and server | 2026-03-09 |
Questions
Which loader does HookLib need?
Where can developers find the API details?
In the catalog
HookLib is one of 3,514 Library mods on ModsFinder, and one of 1,576 Library mods for Forge. 2,920 mods support Minecraft 1.12.2.
More from hohserg
Similar mods
What the author says
This is framework for coremods at MinecraftForge. Doesn't require knowledge of jvm bytecode.
Official listing
- Modrinth page
- modrinth.com/mod/hooklib
- Owner
- hohserg
- Published
- 2024-11-25
- Updated on Modrinth
- 2026-02-11
- Facts verified
- 2026-10-15
