Jump to content

Registering mods item variants


Recommended Posts

So I'm making an item in my mod with 2 parts that may be changeable according to the item's NBT, I made a custom model for this item with a custom model loader and all, but I am facing a problem.


I'm trying to make all possible models from those 2 parts, it would be no problem for my mod's parts to use


and iterate through all possible combinations. However, the problem comes if I ever want another mod to register its own variants that may include my mods parts and other mods' custom ones. Since the models get loaded between preInit and init, no one can guarantee which mod's code runs first in preInit, and what variants to what parts can be registered in a certain mod's preInit, or if even my item was already initialized to register the variants (I may note that my items initialize in a static constructor of my items container but registered later on, which might suggest that they are always initialized when called).


Can I in anyway get over such problems? Is there a way to make some code run before the loading but after preInit? and if not, would these problems be solved if I create a registry for those parts, where mods must register their custom ones, then register all variants whether my mod was already pre-initialized or not? The latter idea will cause variants overlapping if that's a problem.

Link to comment
Share on other sites

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.