Jump to content

[1.14.4] Questions about recipes, advancements and tags


yolp900

Recommended Posts

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

 

Link to comment
Share on other sites

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.

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.