Smithed Summit is back! Check it out here!
You are currently on the unstable branch. Click here to go to safety.
Download
Choose Minecraft Version
1.21.101.21.11v1.10.1
1.21.101.21.10v1.10.1
1.21.101.21.9v1.10.1
1.21.101.21.8v1.10.1
1.21.101.21.7v1.9.1
1.21.101.21.4v1.9.0
1.21.101.21.3v1.8.0
1.21.101.21.2v1.8.0
Close

๐Ÿ“– Furnace NBT Recipes

GitHub Smithed Modrinth PMC Discord Powered by StewBeet

๐Ÿ”ฅ Minecraft datapack library for handling custom furnace recipes with advanced NBT / component support!
Enables creation of complex smelting recipes using NBT tags / components. ๐Ÿ› ๏ธ

๐Ÿ“š How to Use

๐Ÿ”ง Function Tags

The library provides several function tags that you can use to add your custom recipes:

๐Ÿ”จ Smelting, Blasting, Smoking

The function tags are the following:

  • #furnace_nbt_recipes:v1/smelting_recipes: ๐Ÿ”ฅ Recipes in a classic furnace
  • #furnace_nbt_recipes:v1/blasting_recipes: โš’๏ธ Recipes in a blast furnace (e.g. ores)
  • #furnace_nbt_recipes:v1/smoking_recipes: ๐Ÿ– Recipes in a smoker (e.g. food)

๐Ÿ“ In any of these function tags, you must add a call to a function you created that will handle the recipe.
โœ… Each line should check if the #found score is 0 and the input matches your recipe.
๐Ÿ”„ If so, it will run a loot table command in the container.3 slot.

โšก Taken example from SimplEnergy:

# Smelt 'Raw Simplunium' into 'Simplunium Ingot'
execute if score #found furnace_nbt_recipes.data matches 0 store result score #found furnace_nbt_recipes.data if data storage furnace_nbt_recipes:main input{"components": {"minecraft:custom_data": {"simplenergy": {"raw_simplunium": true}}}} run loot replace block ~ ~ ~ container.3 loot simplenergy:i/simplunium_ingot

#furnace_nbt_recipes:v1/disable_cooking

๐Ÿ”ง As the library stands on fake recipes, we need to prevent the default vanilla items from smelting โš ๏ธ
Therefore, you should use this function tag to disable them with the following syntax โฌ‡๏ธ:

# For instance, if a custom recipe uses command block as a base item:
execute if score #reset furnace_nbt_recipes.data matches 0 store success score #reset furnace_nbt_recipes.data if data storage furnace_nbt_recipes:main input{"id":"minecraft:command_block"}

โ™ป๏ธ Like the recipe tags, it runs once per ingredient and furnace type, and its answer is reused by every furnace holding that ingredient: decide from input and #type only.

#furnace_nbt_recipes:v1/recipes_used

โšก Configure XP rewards for your custom recipes when a player retrieves items from the furnace.
๐ŸŽฏ The XP amount can be customized based on the input item and furnace type (๐Ÿ”ฅ regular furnace, โš’๏ธ blast furnace, or ๐Ÿ– smoker).
โœจ Taken example from SimplEnergy:

# Give 0.8 XP for smelting 'Raw Simplunium'
execute if score #found furnace_nbt_recipes.data matches 0 store result score #found furnace_nbt_recipes.data if data storage furnace_nbt_recipes:main input{"components": {"minecraft:custom_data": {"simplenergy": {"raw_simplunium": true}}}} run function simplenergy:calls/furnace_nbt_recipes/xp_reward/0.8

#furnace_nbt_recipes:v1/configure_furnace

โšก Configure a furnace once, the tick the library starts tracking it, so a configured furnace costs nothing extra afterwards.
๐Ÿƒ It runs as the furnace's marker entity, at the furnace, and sets furnace_nbt_recipes.speed, given per thousand: 1000 is the vanilla pace, 8000 cooks eight times faster, and 1200 cooks 1.2 times faster.
๐Ÿงฎ Thousandths exist so a furnace can cook at a fraction of a tick per tick; the leftover is carried between ticks, so even 1050 stays exact over a whole recipe.
๐Ÿ”„ The progress arrow stays smooth at any speed, because the library scales progress onto the clock it holds rather than onto the recipe duration.
โœจ Example, an electric smelter that smelts eight times faster:

# Run as the marker, at the furnace: check whatever identifies your block
execute if entity @e[tag=simplenergy.electric_smelter,distance=..1] run scoreboard players set @s furnace_nbt_recipes.speed 8000

๐Ÿงฉ A block that already has an entity inside the furnace can be tracked through it instead of a marker: add the furnace_nbt_recipes.furnace tag to it, set its furnace_nbt_recipes.speed, and kill any marker the library already placed within 0.75 blocks of it.

๐Ÿ“ Recipe Format

๐Ÿ“ For each custom recipe you make, you'll need to add a recipe that take the base item ingredient as ingredient and result the base item of the result.
โฑ๏ธ The cookingtime field is mandatory, and the game divides it by the speed multiplier of the fuel: write 200 and a furnace takes ten seconds, while a blast furnace or a smoker on vanilla fuel takes five.
โš ๏ธ This part is really wanky and I don't want people to use this library so here is a link to SimplEnergy's example.

โš™๏ธ How the cooking is driven

๐Ÿ• The library owns the furnace clock: it holds the cooking time high enough that the vanilla recipe can never complete on its own, and swaps in your result once the recipe has had its full duration.
โ›ฝ The pace comes from the fuel, whatever it is: a custom fuel with a speed_multiplier of 10 cooks ten times faster, exactly as it would for a vanilla recipe.
๐Ÿ”ฅ Vanilla refuses to light a furnace whose output slot holds an item its own recipe result cannot stack with. The library hands it a free slot for one tick so it lights itself and burns its fuel normally, then puts the item back.
๐Ÿงฑ Two custom results never merge: while the output slot holds a different item, or the same one without room for the result, the furnace stops instead of stacking them, and resumes once the slot is cleared.

๐Ÿงช Tests

๐Ÿ”ฌ The Ward tests in tests/ run against the built pack: uvx "mcward[cli]" test -p build/FurnaceNbtRecipes_datapack.zip -p tests -v 26.3 "furnace_nbt_recipes_test:*"
๐Ÿ” Use -v 26.4-snapshot-7 for the 26.4 snapshot. The first run starts a Ward server that stays up so the next runs take a second, and uvx "mcward[cli]" stop --all stops it.

โญ Star History

Star History Chart

Smithed

Copyright ยฉ 2023-2026 Smithed
Not an official Minecraft product. Not approved by or associated with Mojang Studios