Jump to content

[1.18.2] Custom Recipe Category


JimiIT92

Recommended Posts

So I made a custom recipe type to add functionalities to the Fletching Table. Everything works, but I want to show the toast "Recipe unlocked" when the Player either meets the criteria (like for any other recipe) or craft the item at the fletching table. The idea is that in the upper-right corner it should pop-up a notification similar to the one for smithing table, but with the fletching table icon and the craft result item icon instead. 
I tried to use the RecipeBookCategories#create method, since it looks like every recipe category is hardcoded into that enum, however that method has an hardcoded IllegalStateException.

So how can I add my own custom crafting category into the game?

Don't blame me if i always ask for your help. I just want to learn to be better :)

Link to comment
Share on other sites

4 minutes ago, JimiIT92 said:

RecipeBookCategories#create

this is the way to go, the content of the method (the IllegalStateException) is replace at runtime by ASM,
the IllegalStateException exsist if there was an issue replacing the content

Link to comment
Share on other sites

Ok, so I've created the Recipe Category, but in the log I have this

 Unknown recipe category: blazersmod:fletching/blazersmod:carbon_bow

carbon bow being an Item that can be crafted using the custom recipe type.
I've created it like this
 

RecipeBookCategories.create(BlazersMod.MOD_ID + ":fletching", new ItemStack(BLItems.CARBON_BOW.get()));

and the JSON file for the recipe is the following
 

{
  "type": "blazersmod:fletching",
  "addition": {
    "item": "blazersmod:carbon"
  },
  "base": {
    "item": "minecraft:bow"
  },
  "result": {
    "item": "blazersmod:carbon_bow"
  }
}

So I don't understand why is actually trying to recognize that category instead of the "main" fletching category :/ 

Don't blame me if i always ask for your help. I just want to learn to be better :)

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.