Skip to main content

The introduction to adding HammerLib to your workspace.

Getting Started

Warning!

This documentation describes HammerLib 1.19.2 and newer.

With that being said...

Prerequisites!

🦊 neoforge.mods.toml (NeoForge)

Add this piece of code to your neoforge.mods.toml:

[[dependencies.mod_id]]
modId="hammerlib"
mandatory=true
versionRange="[0.0.0,)"
ordering="NONE"
side="BOTH"

Be sure to replace the 0.0.0 with the actual minimal version you require to run your mod.

🔨 Legacy mods.toml (MinecraftForge)

Add this piece of code to your mods.toml:

[[dependencies.mod_id]]
modId="hammerlib"
mandatory=true
versionRange="[20.1.1,)"
ordering="NONE"
side="BOTH"

Be sure to replace the 20.1.1 with the actual minimal version you require to run your mod.

🆕 public Mod() (your mod constructor)

Classic language files

If you want to continue using .lang files instead of .json files, you should register your mod to be treated with HammerLib's language adapter.

LanguageAdapter.registerMod("modid");