ResourceLocation R = new ResourceLocation(modId, item name);
ForgeRegistries.BLOCKS.getValue(R);
OR
ForgeRegistries.ITEMS.getValue(R);
And it works for mine craft where the mod Id is the string "minecraft" but when I try and use it on a modid and item it doesn't work. is their a reason for this? like something I don't get about this method? its hard to test cus I'm using thi to make a plugin for another mod and when I tried to get the git hub repository into my IDE (eclipse) it didn't really work and I'm still trying to get it to work, so I can only test this mod by compiling it and using it with the other mod.
SO any info you can throw at me would be appreciated.
Thanks in advance.
Those methods should work for any mod's Block/Item.
Are you sure you're using the correct names? What Block/Item are you testing it with?
Post your code using Gist, Pastebin or a GitHub repository.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The mods I'm using are for mine stuck, and pams harvest craft. I made a some code to read through a txt file, and get user made entrys. the whole idea of the mod is to make a plugin to add custom recipes to mine stuck. SO its a little long and confusing, but I can try posting it.
variables I end up using to try and get the items so far have been mod id :harvestcraft item: peanut
and mod id minestuck item pogohammer
I'll try some more stuff now that I know the code should be working, but that's how far i got so far.
EDIT O_O WELP minestuck works. apparently the item is pogo_hammer. Sigh this is embarrassing , My B. Imma try and get the pam thing to work.
edit again: and pams harvest crft works with peanutitem instad of peanut. Myyy b again.
You can view registry names in-game by enabling advanced tooltips with F3 + H.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Hi, I'm trying to use the code:
ResourceLocation R = new ResourceLocation(modId, item name);
ForgeRegistries.BLOCKS.getValue(R);
OR
ForgeRegistries.ITEMS.getValue(R);
And it works for mine craft where the mod Id is the string "minecraft" but when I try and use it on a modid and item it doesn't work. is their a reason for this? like something I don't get about this method? its hard to test cus I'm using thi to make a plugin for another mod and when I tried to get the git hub repository into my IDE (eclipse) it didn't really work and I'm still trying to get it to work, so I can only test this mod by compiling it and using it with the other mod.
SO any info you can throw at me would be appreciated.
Thanks in advance.
Those methods should work for any mod's Block/Item.
Are you sure you're using the correct names? What Block/Item are you testing it with?
Post your code using Gist, Pastebin or a GitHub repository.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The mods I'm using are for mine stuck, and pams harvest craft. I made a some code to read through a txt file, and get user made entrys. the whole idea of the mod is to make a plugin to add custom recipes to mine stuck. SO its a little long and confusing, but I can try posting it.
https://pastebin.com/4ggpEpYR
variables I end up using to try and get the items so far have been mod id :harvestcraft item: peanut
and mod id minestuck item pogohammer
I'll try some more stuff now that I know the code should be working, but that's how far i got so far.
EDIT O_O WELP minestuck works. apparently the item is pogo_hammer. Sigh this is embarrassing , My B. Imma try and get the pam thing to work.
edit again: and pams harvest crft works with peanutitem instad of peanut. Myyy b again.
You can view registry names in-game by enabling advanced tooltips with F3 + H.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
O_O YES! THANK YOU! I will add this info to my tutorial and mod page... if this ever gets a mod page...