Jump to content

MC 1.12.2 Recipes registering


winnetrie

Recommended Posts

I know everyone is telling to use the new json recipes, but i don't like it actually. It is frustrating to create all those files 1 by 1 .....

Instead i would like to do it in code, for now. I might eventually switch.

I wonder if this is the right way to register recipes now in code:

	@SubscribeEvent
	public static void registerRecipes(RegistryEvent.Register<IRecipe> event) {
		
		//adding recipe for clay bucket
		GameRegistry.addShapedRecipe(new ResourceLocation(Reference.MODID + ":" + "clay_bucket"), 
					     new ResourceLocation(Reference.MODID + ":" + "buckets"), 
					     new ItemStack(ItemInit.CLAY_BUCKET), 
					     new Object[] {"B B","B B", "BBB", 'B', new ItemStack(Items.CLAY_BALL)});
	}

 

Link to comment
Share on other sites

1 minute ago, diesieben07 said:

No. Use JSON files. You can generate them automatically if you want.

Do not register recipes in code.

Automatically? Sounds good. Where and how?

Also why not in code? I mean not that i disagree, just want to know why?

Link to comment
Share on other sites

2 minutes ago, winnetrie said:

Automatically? Sounds good. Where and how?

Write a program that generates the JSON files for you.

 

2 minutes ago, winnetrie said:

Also why not in code? I mean not that i disagree, just want to know why?

1.13 brings data packs ("resource packs for servers"). This will eventually bring recipe syncing (client downloads recipes from server). This is not possible with code-based recipes.

Link to comment
Share on other sites

7 minutes ago, winnetrie said:

Ok but what about oredictionary? If i was going to add more wood types, for example "apple_planks". How would i register it as "planks"?

Does this still has to be done in code?

For now, yes. However 1.13 also brings a new system called tags

Edited by diesieben07
  • Like 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

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