ModsFinder

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.

ForgeClient or server, optionalMIT LicenseOpen source1.12.2

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

  1. Coremod framework

    A framework for building Forge coremods that change game classes at load time, with a startup option for loading its main loader.

  2. 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.

  3. Local variable access

    Hooks can receive the local variables of the target method as arguments, which makes the library useful for reading intermediate values.

  4. 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.

1.12.23.28
ReleaseBetaAlphaNot available

Only full game releases are shown. This mod publishes no snapshot builds.

Required by 1 mod

How it compares

Full comparison

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.

ModLoadersGame versionsEnvironmentUpdated
HookLibForge1.12.2Client or server, optional2026-02-11
MixinConBooterForge1.6.1 – 1.12.2Client or server, optional2025-09-26
ConfigAnytimeForge1.12.2Client and server2024-03-26
LMCommonCoreFabric, Forge and NeoForge1.20.1 – 1.21.1Client and server2026-03-09

Questions

Which loader does HookLib need?

HookLib is a Forge library. Files are published only for Forge 1.12.2, so it cannot be used on Fabric or NeoForge.

Where can developers find the API details?

The project has a wiki that covers the API and advanced techniques, and its source code and issue tracker are public.

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

All projects

Similar mods

What the author says

This is framework for coremods at MinecraftForge. Doesn't require knowledge of jvm bytecode.
hohserg, on the Modrinth page

Official listing

Owner
hohserg
Published
2024-11-25
Updated on Modrinth
2026-02-11
Facts verified
2026-10-15

Tags