Skip to content

How to add custom Recipes

Speiger edited this page Aug 28, 2018 · 1 revision

IC2Classic still hardcodes all its recipes, and that won't change because of the annoying part of adding recipes.

But in a fair trade attempt it adds a way to disable IC2C recipes and then add custom ones. All IC2 Recipes for Crafting/Machines are in their respective Json Files with the Recipe ID. Setting a RecipeID to false will turn of the recipe and it won't load.

Now since recipe disabling is a thing now recipe adding needed to be implemented. Thats is done via the "customCraftingRecipes" & "customMachineRecipes" json files.

There is a special format that has to be applied to make sure that recipes are loaded and don't crash.

Lets start with the Crafting recipes.

Crafting Recipes:

{
	"recipes":
	[
		{
			"recipeType": "shaped",
			"hidden": false,
			"output":
			{
				"item": "minecraft:stick",
				"meta": 0,
				"amount": 1,
				"nbt": '{"display":{"Name": "TestingName"}}'
			},
			"pattern": ["OOO", "ILF", "OOO"],
			"inputs":
			[
				{
					"patternID": "O",
					"inputType": "ore",
					"oreID": "dye",
					"amount": 1
				},
				{
					"patternID": "L",
					"inputType": "itemList",
					"items":
					[
						{
							"item": "minecraft:cobblestone",
							"meta": 0,
							"amount": 1
						},
						{
							"item": "minecraft:dirt",
							"meta": 0,
							"amount": 1
						}
					]
				},
				{
					"patternID": "F",
					"inputType": "fluid",
					"fluidID": "water"
				},
				{
					"patternID": "I",
					"inputType": "item",
					"item":
					{
						"item": "minecraft:stick",
						"meta": 0,
						"amount": 1
					}
				}
			]
		}
	]
}

So to load recipes you have to have a array that is called "recipes".
Inside of that array are objects that represent recipes.
First thing that has to be provided is the "recipeType", which can be either shaped or shapeless.
Only difference is that you need to provide a "pattern" and the "patternID" in the recipe/recipe components.

Next thing that has to be provided is a "output" which has to have these values:

"item": defines the item being used.
"meta": which meta/durability the item should have.
"amount": how many should be in the result.
"nbt": what the NBTData should be. you have to do ' insteadof " else json doenst like that. Also this field is 100% optional.

After that you provide in the shaped recipes the pattern, which is a String array of max 3 chars per string and max 3 strings.
This pattern represents the crafting grid.

Next thing is the inputs. Which is a Object array.
In this Object the following things have to be provided:

"patternID": Which provides which pattern character it represents (shaped only)
"inputType": What type of input it actually is. (Valid things: "ore", "fluid", "item", "itemList")
And next you have to use the spesific things for each valid input:

Ore requires:
"oreID": the oredictionary name
"amount": how many items are required of it. (Defaults to 1 if not present)

Fluid requires:
"fluidID": the name of the fluid, (water = "water", lava = "lava")

Item requires:
"item": defines the item being used.
"meta": which meta/durability the item should have.
"amount": how many items it should be.
"nbt": what the NBTData should be. you have to do ' insteadof " else json doenst like that. Also this field is 100% optional.

Item list requires:
"items": a Object array of Item. (Look the prev one), and this one means 1 of the provided items like oredict.

That convers the input.
Next optional field is "hidden", which allows you to make the recipe invisible.

and that covers shaped & shapeless recipes.

Machine Recipes

This category assumes you read the Crafting recipes at least a bit.

{
	"recipes":
	[
		{
			"recipeType": "macerator",
			"outputs":
			[
				{
					"item": "minecraft:stick",
					"meta": 0,
					"amount": 64,
					"nbt": '{"display":{"Name": "TestingName"}}'
				}
			],
			"recipeMetadata": '{}',
			"recipeExperience": 1.05,
			"input":
			{
				"inputType": "ore",
				"oreID": "oreDiamond"
			}
		},
		{
			"recipeType": "massFab",
			"input":
			{
				"inputType": "ore",
				"oreID": "oreDiamond"
			},
			"amplifier": 100000
		},
		{
			"recipeType": "electrolyzer",
			"recipeEnergy": 10000,
			"direction": "both",
			"input":
			{
				"item": "minecraft:stick",
				"meta": 0,
				"amount": 64
			},
			"output":
			{
				"item": "minecraft:dirt",
				"meta": 0,
				"amount": 64
			}
		},
		{
			"recipeType": "cannerFuel",
			"fuelType": "multiplier",
			"multiplier": 0.5,
			"input":
			{
				"item": "minecraft:dirt",
				"meta": 0,
				"amount": 64
			}
		}
	]
}

So like the crafting recipes you have to initialize the recipes with a "recipes" object array.
First thing you have to define the "recipeType" to say which type of machine recipe should be added.

First machine to cover are the "macerator/extractor/compressor/recycler".
These machines share a tab since these are exactly the same.

In there you have to provide a Object Array (or Object) that is called "outputs",
these have to be items, and can be as many as you want. These will be all added, but you can't randomize these.
The machines have a infinite output buffer that will handle multible outputs.

Next thing is the "recipeMetadata" which allows you to control the recipe processing length & energy consumtion.
It is a NBTTagCompound that can be provided, but doesn't have to.
These are the valid entries:
Possible Recipe Mods/Flags:
"RecipeEnergyModifier": Double Value which allows you to give a Multiplier to the Recipe Energy Needed.
"RecipeEnergy": Integer Value which allows you to give a Direct Energy Increase/Decrease to the Recipe. (Supports negatives)
"RecipeTimeModifier": Double Value which allows you to give a Multiplier on the Time that the Machine needs to process this Recipe.
"RecipeTime": Integer Value which allows you to give a Direct time value that the machine needs extra/less to process this machine (Supports negatives)
These modifiers have to be in that NBTCompound you provide and no SubCompounds supported.

Next optional thing is "recipeExperience" which allow you to control how much experience a recipe drops. (this gets also supported by expcollector upgrade)

Last thing for these machines is the "input" which is a single entry but works exactly like a shapeless recipe in terms of types that are supported.

Next machine is the "massFab",
this machine has only 2 parameters which is: "input" parameter that works exactly like a macerator machine and the "amplifier" parameter which tells how much amplifier this item provides in the massfabricator.

Next machine is the "electrolyzer",

This machine has a Input/Output parameter which both have to be items (no ore/fluid/itemlist support)
"recipeEnergy": tells how much energy is being used/gave back in the process.
"direction": Tells which way the recipe goes. (Valid Values: "both", "discharge", "charge")

That covers the Electrolyzer.

Last machine is the canner, this one is also very simple:
You have a input which has to be a item.
"fuelType": defines what fuel type it is "multiplier" or "adaptive".
depending on which fuel type is picked, the next parameter will be different.
If "multiplier" is picked, then a "multiplier" parameter has to be created which is a float/double which defines how much fuel in % gets added to the existing fuel.
If "adaptive" is pickt then a integer is provided that tells how much fuel in ticks is going to be added.

This covers all the machines that you can add things with.

1.19.2

1.19.x ResourcePacks

Ores
Ingots & Blocks
Rubber

Generator
Geothermal Generator
Water Mill
Solar Panel
Wind Mill
Nuclear Reactor
Steam Reactor
Thermal Generator
Basic Steam Turbine
Solar Turbine
Liquid Fuel Generator
Slag Generator
Wave Generator
Ocean Generator
Fuel Boiler
Flux Generators

Transmission & Storage

Storage Units
Transformers
Cables
Charge Pads
Luminators

No-Voltage Machines
Stone Macerator
Iron Furnace
Wood Gasificator
Industrial Worktable
Low-Voltage Machines
Macerator
Electric Furnace
Compressor
Extractor
Canning Machine
Recycler
Sawmill
Miner
Magnetizer
Crop Analyzer
Crop-Matron
Electrolyzer
Pump
Sound Beacon
Electric Wood Gasificator
Rare Earth Extractor
Crop Library
Machine Buffer
Machine Tank
Medium-Voltage Machines
Rotary Macerator
Induction Furnace
Singularity Compressor
Centrifugal Extractor
Vacuum Canner
Compacting Recycler
Charged Electrolyzer
Reactor Planner
Crop Harvester
Ore Probe
Tesla Coil
Overclocked Pump
Ranged Pump
High-Voltage Machines
Electric Enchanter
Mass Fabricator
Teleporter
Terraformer
Uranium Enricher
Extreme-Voltage Machines
Plasmafier
Ludicrous-Voltage Machines
Teleporter Hub

Nuclear Reactors

Reactor Planner
Nuclear Reactor
Steam Reactor
Uranium Enricher
Reactor Components

Tools and Armor

Tools
Treetap
Bronze Tools
Wrench
Insulation Cutter
CF Sprayer
Dynamite Remote
Frequency Transmitter
EU Reader
Machine Tool
Thermometer
Tool Box
Cells
Painters
Scanners
TFBP
Batteries & Energy Packs
Mining Drill
Diamond Drill
Chainsaw
Electric Hoe
Electric Treetap
Electric Wrench
Precision Wrench
Nano Saber
Mining Laser
Mowing Tool
Electric CF Sprayer
Obscurator
Portable Teleporter
Debug Item (Admin)
Armor
Bronze Armor
Composite Armor
Hazmat Suit
CF Backpack
Solar Helmets
Static Boots
NightVision Goggles
Jetpacks
Nano Suit
Quantum Suit
Shields

Machine Upgrades
Inventory Upgrades
Chargepad Modules
Upgrade Kits

Components

JsonCrops
Overgrowth Fertilizer
Cropnalyzer
Terrawart

Other Blocks and Items

Advanced Comparator
Scaffolds
Iron Fence
Rubber & Resign Sheet
Crafting Components
Construction Foam (CF)
Reinforced Blocks
Explosives
Boats
Coins
UU-Matter

Personal Blocks

Personal Storage
Trade O Mats

Keybindings

Clone this wiki locally