Jump to content

Recommended Posts

Posted

I have been working the past couple weeks for make my mod highly configurable. I'm down to one more chicken, then realize that the class I created to handle everything doesn't support modded items. Part of this is because the items have to be called via String, which works great for vanilla items. So my question is, is there a way to convert a String into an Item? normally I would just have MainModClass.ModItem but since you cannot store things in configs as an 'Item' its not as simple. I have looked around the code and haven't found anything useful.

Posted

Use GameData.getItemRegistry() and then get the name for the items and get the items back from names.

 

The names are in the form of modid:unlocalisedName

Thank you, this worked for me, and actually allowed me to condense my code down by almost half in the spots i used this in.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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