Jump to content

Looking up mod name from modid?


Recommended Posts

Like all modding you can usually figure this stuff out yourself by looking at similar functionality in the vanilla code. So you think where is the mod names displayed? Well if you aren't sure you look at the vanilla GUI classes. In the minecraft package there is the GuiMainMenu and if you look at the code there, it shows that when one of the buttons is pressed it calls a gui class at net.minecraftforge.fml.client.GuiModList.


So then you look in that class and see how it gets the names. What you'll find is that it finds things of class ModContainer that are held in the Loader.getInstance().getModList(). So that looks promising.


Then if you look at the ModContainer class you can check out if there are methods to get the mod name (there is getName()) and mod id (there is getModId()).


So that should give you enough information to figure out names for a given mod name. You would just cycle through the Loaders mod list and check if the name of the ModContainer matches and if it does then also look up the mod id.


Anyway, I didn't know this until I just researched it so that is why I'm explaining how to figure this out yourself next time. Most of us don't know the answers, we just are able to research them efficiently.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

This topic is now closed to further replies.


  • Create New...

Important Information

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