theishiopian Posted September 30, 2018 Posted September 30, 2018 I'm trying to get an item using its registry name, which I'm representing as a string. This works fine with vanilla items, like minecraft:dirt, but not with modded ones like foragecraft:leek. Is there a different method I should use? Quote
Animefan8888 Posted September 30, 2018 Posted September 30, 2018 2 minutes ago, theishiopian said: I'm trying to get an item using its registry name, which I'm representing as a string. This works fine with vanilla items, like minecraft:dirt, but not with modded ones like foragecraft:leek. Is there a different method I should use? Use ForgeRegistries.ITEMS.getValue Quote VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Draco18s Posted September 30, 2018 Posted September 30, 2018 That should work just fine. Quote Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
theishiopian Posted September 30, 2018 Author Posted September 30, 2018 That works. Additionally, I was trying to run this in preinit, and that was also contributing to the problem, as the items didnt exist yet. Thanks. Quote
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.