Skip to content

Adding recipes and fuels

Blodhgarm edited this page Aug 23, 2023 · 15 revisions

Creating a recipe

When creating an Alloy Forge recipe you want to use the alloy_forgery:forging type.
The recipe can be placed anywhere under data/namespace/recipes in your data.
Here is an example of a recipe:

{
  "type": "alloy_forgery:forging",
  "inputs": [
    {
      "tag": "minecraft:copper_ores"
    }
  ],
  "output": {
    "id": "minecraft:copper_ingot",
    "count": 3
  },
  "overrides": {
    "2": {
      "id": "minecraft:copper_ingot",
      "count": 4
    },
    "3+": {
      "id": "minecraft:copper_ingot",
      "count": 5
    }
  },
  "min_forge_tier": 1,
  "fuel_per_tick": 5
}

Here is what each of the objects do:

  • inputs - Array of the ingredients, shapeless (order does not matter)
    • Accepts item ID or tag.
    • count can be added for custom stack counts [Version 2.0.16 and above].
    • Can hold up to 10 items.
  • output - Output item
    • id - The ID of the item.
    • count - The amount of the item.
  • overrides - Overrides allow changing the output item depending on the tier of the Forge. Accepted formatting:
    • "2" - The override applies only to tier 2.
    • "3+" - The override applies to tier 3, and anything above it.
    • "2 to 5" - The override only applies to the specified range of tiers, in this case from tier 2 to tier 5.
  • min_forge_tier - The minimum Forge tier required to use this recipe.
  • fuel_per_tick - The fuel consumed by the Forge per tick. One bucket of lava is 24000 fuel.

Recipe Remainders

Supported as of version 2.0.17+, requires owo-lib 0.8.0+

Due to Vanilla's very generic Recipe Remainders, you can use owo's Recipe Specific Remainders instead, allowing for fully customizable recipe remainders, or use the built-in Global Remainer System loaded thru the data/{your_mod_id_here}/forge_remainder folder.

A example for Global Alloy Forgery Remainders is below:

{
  "remainders": {
    // Count is supported
    "minecraft:iron_ore": {
      "item": "minecraft:cobblestone",
      "count": 4
    },

    // Turn copper in input to sand
    "minecraft:copper_ore": "minecraft:sand",
  }
}

In the upper example you can declare a map of your item to an object.

The initial Item ID here is the input to be replaced. Supported settings:

  • item - The ID of the returned item.
  • count - Custom stack counts (optional)

In the lower example, the initial item (copper ore) is what is being checked for, and the second item (sand) is returned once the recipe completes.

Tagged Output

Supported as of version 2.0.16+

You can provide your Alloy Forge recipes with tagged outputs.

The benefit of using these is that you can determine priority on a mod basis, allowing you to specifically output a preferred mods material, without it needing to be present.

See the provided example below:

{
  "fabric:load_conditions": [
    {
      "condition": "fabric:item_tags_populated",
      "values": [
        "c:raw_lead_ores",
        "c:lead_ingots"
      ]
    }
  ],
  "type": "alloy_forgery:forging",
  "inputs": [
    {
      "tag": "c:raw_lead_ores",
      "count": 2
    }
  ],
  "output": {
    "priority": [
      "techreborn:lead_ingot",
      "indrev:lead_ingot",
      "modern_industrialization:lead_ingot"
    ],
    "default": "c:lead_ingots",
    "count": 3
  },
  "overrides": {
    "2+": {
      "count": 4
    }
  },
  "min_forge_tier": 1,
  "fuel_per_tick": 5
}

Here is what each of the new objects do:

  • output - Output item
    • priority - Array of the items to prioritize
      • For each item, it will be checked if it exists, and if found it will be used as the output.
      • If the item at the top of the array does not exist, it will simply check the next item.
      • If no item was found from the array, but the tag has any entries, it will default to grabbing from the default tag
    • default - Default tag in which to grab from if none of the priority items are found
      • Unless you change the tags contents, it should always be the same item output each time
    • count - The amount of the item.
  • overrides - Functions the same as overrides, although the output is automatically obtained from the above options

Adding new fuels

Alloy Forgery loads fuel from a specific folder in data.
The path is data/namespace/alloy_forge_fuels, and in here you put your fuel definition.
A fuel file does not require a specific name, and can hold multiple different fuels.
Currently we only support items for fuels, tags are not accepted.
An example is provided below:

{
  "fuels": [
    {
      "item": "minecraft:lava_bucket",
      "return_item": "minecraft:bucket",
      "fuel": 24000
    },
    {
      "item": "minecraft:coal",
      "fuel": 1000
    },
    {
      "item": "minecraft:charcoal",
      "fuel": 1000
    },
    {
      "item": "minecraft:blaze_rod",
      "fuel": 2000
    },
    {
      "item": "minecraft:coal_block",
      "fuel": 9000
    }
  ]
}

The special field return_item is optional, and is intended for when you want to do something similar to returning an empty bucket after using a lava bucket with the forge.