Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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 :)

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

  • Author

Got it, during which event should I call the create method?

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

  • Author

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 :)

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.