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

I have a few questions about the crafting system, advancement system and tag system:

 

1. The crafting system: I'm using ShapedRecipeBuilder and ShapelessRecipeBuilder. Say I want to have two different crafting recipes for the same item - How would one do so? Is there an example in vanilla which I missed?

2. About the advancement system: I'm using .addCriterion with InventoryChangeTrigger.Instance.forItems to add a list of items which are needed for the craft. However this only allows a list of items. Is there a way to use tags? i.e. whenever the player has items from the relevant tags - the crafting recipe will be exposed (as opposed to specific items).

3. The new tag system: Is there a convention about adding tags - Which tags are common (other than the given tags in forge), how tags are supposed to be added (I'm extending BlockTagsProvider and ItemTagsProvider from vanilla, is there a way to do so from Forge which I haven't found?). For example, I expected there would be a tag for paper. If I were to add a paper equivalent and wanted recipes to use it too, what should I do?

 

I think theses are general questions which don't need code samples, but just in case here is an example of how I register a recipe:

ShapedRecipeBuilder.shapedRecipe(ModItems.SPELL_PARCHMENT)
                .patternLine(" B ")
                .patternLine("PPP")
                .patternLine(" B ")
                .key('B', ModItemTagsProvider.BINDING_REAGENT)
                .key('P', Items.PAPER)
                .setGroup(Spellies.MOD_ID + "." + SpellParchment.REGISTRY_NAME)
                .addCriterion(SpellParchment.REGISTRY_NAME, InventoryChangeTrigger.Instance.forItems(ModItems.LIGHT_BINDING_REAGENT, Items.PAPER, ModItems.DARK_BINDING_REAGENT))
                .build(consumer);

 

44 minutes ago, yolp900 said:

1. The crafting system: I'm using ShapedRecipeBuilder and ShapelessRecipeBuilder. Say I want to have two different crafting recipes for the same item - How would one do so? Is there an example in vanilla which I missed?

Make two recipe files

 

Quote

2. About the advancement system: I'm using .addCriterion with InventoryChangeTrigger.Instance.forItems to add a list of items which are needed for the craft. However this only allows a list of items. Is there a way to use tags? i.e. whenever the player has items from the relevant tags - the crafting recipe will be exposed (as opposed to specific items).

Use the json system?

  "criteria": {
    "has_planks": {
      "trigger": "minecraft:inventory_changed",
      "conditions": {
        "items": [
          {
            "tag": "minecraft:planks"
          }
        ]
      }
    },

 

Quote

3. The new tag system: Is there a convention about adding tags - Which tags are common (other than the given tags in forge), how tags are supposed to be added (I'm extending BlockTagsProvider and ItemTagsProvider from vanilla, is there a way to do so from Forge which I haven't found?). For example, I expected there would be a tag for paper. If I were to add a paper equivalent and wanted recipes to use it too, what should I do?

You don't need to do that. Just create the json file and call BlockTags/ItemTags.getCollection().getOrCreate(...)

Its right there in the docs.

Edited by Draco18s

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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.