Skip to content

How to make a furnace recipe in a Minecraft mod

A furnace recipe is a JSON file in your mod’s data/<modid>/recipe folder (recipes before 1.21) with the type minecraft:smelting: one ingredient, the result, the experience it gives and how many ticks it cooks (200 is ten seconds).

Works on Minecraft 1.20.1 to 26.3 on NeoForge; Minecraft 1.16.5 to 26.3 on Fabric; Minecraft 1.16.5 to 1.20.1 on Forge; Minecraft 1.12.2 on Forge. Each example was compiled against its loader and version before it shipped in Linen.

  1. Make a JSON file in data/<modid>/recipe/ (recipes/ before 1.21).
  2. Set its type to minecraft:smelting.
  3. Name the ingredient and the result.
  4. Set the experience and the cooking time in ticks.

The example uses these values. Change them in the code.

Setting In the example What it does
ingredient minecraft:sand What goes into the furnace.
result minecraft:glass What comes out.
experience 0.1 The experience it gives.
time 200 Cooking time in ticks (20 ticks are a second).

The example mod is examplemod in the package com.example.examplemod. Use your own mod id and package.

Fabric 1.16.5 to 26.3, NeoForge 1.20.1 to 26.3, Forge 1.16.5 to 1.20.1

Section titled “Fabric 1.16.5 to 26.3, NeoForge 1.20.1 to 26.3, Forge 1.16.5 to 1.20.1”

Uses:

  • minecraft:smelting

Uses:

  • GameRegistry.addSmelting
  • RegistryEvent.Register<IRecipe>

1.12.2 has no smelting recipe files: GameRegistry.addSmelting makes the recipe in code. The cooking time is always 200 ticks.

src/main/java/com/example/examplemod/recipe/GlassFromSandSmelting.java

package com.example.examplemod.recipe;
import com.example.examplemod.ExampleMod;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.common.registry.GameRegistry;
// minecraft:sand smelts into minecraft:glass in a furnace, with 0.1F experience. 1.12.2 smelting recipes are made in code, not in a file, and always take 200 ticks.
@Mod.EventBusSubscriber(modid = ExampleMod.MOD_ID)
public final class GlassFromSandSmelting {
private GlassFromSandSmelting() {
}
// Recipes are registered after the items, so this also works for the items of your own mod.
@SubscribeEvent
public static void onRegisterRecipes(RegistryEvent.Register<IRecipe> event) {
Item input = ForgeRegistries.ITEMS.getValue(new ResourceLocation("minecraft:sand"));
Item output = ForgeRegistries.ITEMS.getValue(new ResourceLocation("minecraft:glass"));
GameRegistry.addSmelting(new ItemStack(input), new ItemStack(output), 0.1F);
}
}

Linen’s How-tos library has this page too, with the example for your own mod’s loader and Minecraft version. Hover a name in your code and Linen points to the how-tos that explain it. Both are free. Download Linen.