Jump to content

(1.18.2) Good Recipe Tutorial


badkraft

Recommended Posts

I'm adding quite a few recipes. Some are shapeless but I'm not sure how to add shapeless recipes when they are like nuggets -> ingot & ingot -> nuggets.

I've also got some smelting recipes for the furnace. It looks like it is fairly involved - adding some class implementations, etc. No big deal, just need a simple, step-by-step tutorial.

I'm actually seeing where there is a huge need for tools to help build mods. Oh boy...

Any leads on adding some special recipes for the campfire would be nice... 

Link to comment
Share on other sites

Unfortunately, the results are slim. I'll approach from a couple of avenues:

1. Look at available source from other mods

2. Follow kaupenjoe's tutorial on YouTube.

 

Problem with kaupenjoe is that I'm not a advanced yet as he's starting. I've got a couple recipes to craft court ingot to nuggets and copper nuggets to ingot.

Then I've gotta add some smelting recipes to smelt nuggets ores into nuggets - copper, iron, gold.

Changing up the diamond drops a bit so I'll have some green cutting recipes to add. Those are more advanced.

Then some carpentry recipes changing up how we work with logs, planks, fencing, walls, doors, floors, etc.

Got a lot of work ahead. But it's fun.

Also gotta learn about block generation. Ugh... anyone wanna help? 😁

Edited by badkraft
formatting
Link to comment
Share on other sites

Okay, if you're having trouble with kaupenjoe's tutorials it's because he assumes you already have a solid understanding of Java, so he skips over explaining that aspect of what he's doing - which is a lot, since it's all in Java. This website should be very helpful in understanding whatever methods or parts he uses in his videos. 

https://www.w3schools.com/java/ 

Just click the GitHub link he provides with his tutorials, and look up on that site whatever you don't understand. Don't be afraid to take your time with this. Same goes for anything else you run into that you don't understand since this site covers many other programming languages, not just Java. In fact, if you click on their tutorials tab you'll find JSON under the Javascript heading in there too.

Link to comment
Share on other sites

I'm not having trouble with Java ... picking it up pretty fast. I've been a software engineer for .Net C# for 10+ years. I'm following his tutorial for an advanced block with recipes (the gem cutting station). There is a lot more to write for recipes than for just blocks and items. That's not a problem. Just having to watch many times to get it all.

Link to comment
Share on other sites

4 hours ago, badkraft said:

I'm not having trouble with Java ... picking it up pretty fast. I've been a software engineer for .Net C# for 10+ years. I'm following his tutorial for an advanced block with recipes (the gem cutting station). There is a lot more to write for recipes than for just blocks and items. That's not a problem. Just having to watch many times to get it all.

Ah, I get it. Personally, I find reading easier than listening to be honest, especially when there's a lot to process and absorb. And that guy does go fast from what I've seen. At least with a video you can pause it to compare notes and text when you need to. I'm sorry if I insulted you in any way, it wasn't my intention.

  • Like 1
Link to comment
Share on other sites

10 hours ago, badkraft said:

No...not insulted at all. No one knows who I am or what I do. No worries. I do wish there was better Forge documentation, though.

First, recipes are a vanilla system. The best thing to do is look at how vanilla does it in the source code and replicate it, replacing any necessary steps with their Forge wrapped counterpart (registries, itemstack result, etc.)

Additionally, there is some documentation on the custom recipe process; however, it is community generated. If you choose to complain about the Forge documentation, please provide information on where it is lacking on an issue on the repo. I will be happy to address those concerns since I've put myself in the position to be responsible for it.

Link to comment
Share on other sites

11 hours ago, ChampionAsh5357 said:

First, recipes are a vanilla system. The best thing to do is look at how vanilla does it in the source code and replicate it, replacing any necessary steps with their Forge wrapped counterpart (registries, itemstack result, etc.)

I've made a few recipes (smelting & shape). I have the .json recipes that, for instance, produce a spacium ingot: either smelt a spacium ore block or put 9 spacium nuggets into a crafting grid. Well, those have specific names for the json -

  • spacium_ingot_from_spacium_ore.json
  • spacium_ingot_from_spacium_nuggets.json

If there was only one shaped or shapeless recipe to create spacium ingot, then naming the recipe `spacium_ingot.json` is all you have to do. But because we have 2 recipes producing the same item from two different processes, I'm trying to figure out how to "register" these recipes. Kaupenjoe is talking about a custom item from a custom block (gem cutting).

If I need to build all the same registry items - e.g. recipe serializers - then that's fine. I'm trying to find the correlation between the name of the .json file and what is in the code. That's where I'm really missing something integral.

Link to comment
Share on other sites

3 hours ago, badkraft said:

I've made a few recipes (smelting & shape). I have the .json recipes that, for instance, produce a spacium ingot: either smelt a spacium ore block or put 9 spacium nuggets into a crafting grid. Well, those have specific names for the json -

  • spacium_ingot_from_spacium_ore.json
  • spacium_ingot_from_spacium_nuggets.json

If there was only one shaped or shapeless recipe to create spacium ingot, then naming the recipe `spacium_ingot.json` is all you have to do. But because we have 2 recipes producing the same item from two different processes, I'm trying to figure out how to "register" these recipes. Kaupenjoe is talking about a custom item from a custom block (gem cutting).

If I need to build all the same registry items - e.g. recipe serializers - then that's fine. I'm trying to find the correlation between the name of the .json file and what is in the code. That's where I'm really missing something integral.

If you used the vanilla recipe types, meaning that in the "type" part of your recipe's Json file is "smelting", "shaped_recipe", "shapeless_recipe", etc. then the only thing you need to do is put it in the recipe folder. It's the recipe types that get registered. So your recipes using vanilla types don't need anything extra once the Json file is made.

Registering for recipes come in when say you want to make a recipe "type" called maybe, I don't know, "spacium_smelting" for example. There you would tell Forge what recipe format it uses, which block entity type uses it, and how to read it, etc.

Edit: Oh, wait, I meant to also say that the vanilla "smelting" type is tied to the furnace for example while the vanilla "shaped_recipe" and "shapeless_recipe" are tied to the crafting table. So if you want these vanilla types to also be connected to your custom block entity, then you will to make a custom recipe type with a different name that uses the same format. You'd make them the same way as their serializer, but just replace the name of it with your custom name where ever it pops up and then register this custom type. After that, when you make recipes for it, you just plug in your recipe type's name in the json file and stick the file into your recipe folder. I really hope I'm making sense here.

Edited by Warren Tode
Link to comment
Share on other sites

19 hours ago, Warren Tode said:

If you used the vanilla recipe types, meaning that in the "type" part of your recipe's Json file is "smelting", "shaped_recipe", "shapeless_recipe", etc. then the only thing you need to do is put it in the recipe folder. It's the recipe types that get registered. So your recipes using vanilla types don't need anything extra once the Json file is made.

I figured out what was wrong ... you can spot it pretty quick most likely:

{
  "type": "minecraft:smelting",
  "ingredient": {
    "item": "minecraft:gold_nugget_ore"
  },
  "result": "minecraft:gold_nugget",
  "experience": 0.25,
  "cookingtime": 150
}

 

... so, after changing `minecraft` to `foundations` for all the custom items and all the recipes work. Well that's what copy/paste will get you.

One last question about recipes, though. What does the following json key/value do in the game?


  "group": "copper_ingot"

 

Edited by badkraft
Link to comment
Share on other sites

3 hours ago, badkraft said:

One last question about recipes, though. What does the following json key/value do in the game?


  "group": "copper_ingot"

 

I think the old saying is, "The devil is in the details." Far too often I find this to be the case.

The "group" defined in the json file deals with the recipe book and how crafts show up in there. I think maybe the best way to explain this is with a couple of screenshots.

sAvH1K0.png

So you see the wool and how it says "right click for more" when you hover over it? This is because I have more than one dye along with the stack of wool to craft with here. If I just sit there, it will toggle through the other colors I have available in my inventory. When you right click on it, you get this:

PZN2gtQ.png

It gives you a collection of similar recipes. This is what a "group" does. It works for vanilla and modded. You don't need to bother with it if you don't want to, but some people like it since it declutters the book so to speak.

I hope this helps.

  • Thanks 1
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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