Frequently Asked Questions
General
What Minecraft / NeoForge versions does RegistryLib support?
RegistryLib targets NeoForge 26.1 on Minecraft 1.21+. Check the GitHub releases page for the exact version matrix.
Is RegistryLib a fork of Registrate?
RegistryLib is inspired by Registrate but is a clean-room rebuild for modern NeoForge. It shares the fluent-API philosophy but differs in implementation, type hierarchy, and feature set. See What is RegistryLib? for a detailed comparison.
Can I use RegistryLib alongside vanilla registration?
Yes. RegistryLib does not replace the NeoForge registry system; it wraps it. You can mix RegistryLib chains with DeferredRegister calls in the same mod without conflict.
Setup
Gradle cannot resolve the RegistryLib dependency
- Ensure your
settings.gradleorbuild.gradleincludes the Gtodyssey Maven repository:https://maven.gtodyssey.com/releases. - Check your network can reach
maven.gtodyssey.com. - Run
./gradlew build --refresh-dependenciesto clear cached resolution failures.
See Installation & Setup for the full walkthrough.
runData or runClient fails at startup
- Confirm your NeoForge and Minecraft versions align with the RegistryLib release you are using.
- Make sure the class that initializes
RegistryCore.create(MOD_ID)is loaded during mod construction, such as from your@Modclass.
Registration
I called .register() but the item does not appear in-game
- Class not loaded: the field holding your
ItemEntrymust be in a class that is referenced during mod construction. A static field in an unreferenced class is never initialized. - Missing creative tab: call
.addDefaultTab()or.addTab(...)to place it in a creative tab. - Missing model/texture: call
.defaultModel(), or provide a texture via.texture(...)or a resource pack.
I used to get a NullPointerException from .get() but now I see an IllegalStateException
This is intentional. Entry .get() now throws IllegalStateException with a descriptive message instead of a raw NPE. The fix is the same: do not call .get() before registration completes. If you need a safe check, use isBound() or getOptional(). See Troubleshooting for details.
What is the difference between item() and componentItem()?
item() creates a plain Item. componentItem() creates a ComponentItem or IComponentItem implementation that supports the attachment system for modular behavior composition. Use componentItem() when you need .attach(...).
Can I register entries conditionally?
RegistryLib builders are submitted at .register() time. You can conditionally skip chains with normal Java control flow. However, once .register() is called, the entry is registered unconditionally; there is no built-in config-gated registration.
Datagen
My language file is missing entries
- Ensure
.lang("Display Name")is present on each chain, or use.defaultLang(). - Run
./gradlew runDataafter any lang change. RegistryLib generates lang files during datagen, not at runtime.
How do I add recipes?
Use addRecipeData(...) on your builder chain or on RegistryCore. See Recipes and Tags.
Still stuck?
Check the Troubleshooting page for error-specific solutions, or open an issue on GitHub.