[SOLVED} Help with: Hide the Recipe for my Item from NEI

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
[SOLVED]
First reply has solution

Firstly: I googled this, and all that came up was a bunch of stuff about users (not modders) reducing the page count in NEI. I also searched the forum; nothing came up. :p

I'm using Minecraft 1.7.10 and Forge v1.7.10-10.13.2.1291.
I'm just learning to mod (specifically from Pahimar's Let's Mod Reboot tutorial), and I've got an item with a recipe. I want the item to be secret, so I'd like to hide the recipe (but not the item) from NEI. Is there a way to do that?

One other question, not-fully-related to this topic:
How do I make code that only executes if a certain mod is found in the environment? This is specifically for adding something using an item from another mod.
(I'll post that again in it's own thread if I can't find anything from google; it'd be nice to have some up to date info from someone experienced, though)
 
Last edited:

gardenapple

Well-Known Member
Mod Developer
Jan 14, 2014
176
265
93
One other question, not-fully-related to this topic:
How do I make code that only executes if a certain mod is found in the environment?
This one is easy:
Code:
if(Loader.isModLoaded(String modid)){
   //stuff
}
You should be able to find the mod id via the "Mods" list in the main menu.

I'm just learning to mod (specifically from Pahimar's Let's Mod Reboot tutorial), and I've got an item with a recipe. I want the item to be secret, so I'd like to hide the recipe (but not the item) from NEI. Is there a way to do that?
Not exactly sure how to do this. One cheaty way to do it is to make your own recipe class, an exact copy of ShapedOreRecipe. (NEI won't recognize it because it will be a different class). Then you should be able to use it like this:
Code:
RecipeSorter.register("modid:hiddenshaped", HiddenShapedRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped");

GameRegistry.addRecipe(new HiddenShapedRecipe( //your recipe));
 
  • Like
Reactions: Type1Ninja

Type1Ninja

New Member
Jul 29, 2019
1,393
-7
0
This one is easy:
Code:
if(Loader.isModLoaded(String modid)){
   //stuff
}
You should be able to find the mod id via the "Mods" list in the main menu.


Not exactly sure how to do this. One cheaty way to do it is to make your own recipe class, an exact copy of ShapedOreRecipe. (NEI won't recognize it because it will be a different class). Then you should be able to use it like this:
Code:
RecipeSorter.register("modid:hiddenshaped", HiddenShapedRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped");

GameRegistry.addRecipe(new HiddenShapedRecipe( //your recipe));
Thankyouthankyouthankyouthankyouthankyou. :D
This is exactly what I want, and definitely well within my ability set. :)

EDIT: how do you do code tags?
 
Last edited:
  • Like
Reactions: gardenapple