Error when loading mod (NoClassDefFoundError: net/minecraft/item/Itemgroup)
By
Chise986,
in Modder Support
-
Recently Browsing
- No registered users viewing this page.
-
Posts
-
Do you know a good example? I just tried to find a good example in well known mods and they seem to use a variant of the RegistryEvent/manual register like botania, except mekanism which has its own specialised FeatureDeferredRegistry implementation.
-
By diesieben07 · Posted
Then it is a bad example to give on the Forge forums. -
Pretty sure it does it that way because it shares the same code with the fabric implementation which doesn't have deferred registration.
-
By diesieben07 · Posted
This is not ideal. The recommended way to register things is using DeferredRegister, which also provides you with the Holder. -
It depends what version of forge you are using. The old way (1.18 and before) is to use BiomeLoadingEvent. Then use event.getGeneration().addFeature() to add it to the appropriate GenerationStep. For an example, here is Botania adding mystical flowers and mushrooms to the vegetation step https://github.com/VazkiiMods/Botania/blob/0cfa08ebb4828aa48b3231d6db6dd3b70dc7942b/Forge/src/main/java/vazkii/botania/forge/ForgeCommonInitializer.java#L250 Of course you need to register your features to make them useful, see https://github.com/VazkiiMods/Botania/blob/0cfa08ebb4828aa48b3231d6db6dd3b70dc7942b/Xplat/src/main/java/vazkii/botania/common/world/ModFeatures.java 1.19 (still in beta) has overhauled this to use BiomeModifiers:https://forge.gemwire.uk/wiki/Biome_Modifier
-
-
Topics
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.