Infusion Crafting

Infusion crafting is the most powerful crafting system in Thaumcraft. It is performed at the Infusion Altar and supports recipe transformation, enchantment application, and multi-component recipes with instability mechanics.

Registration

ThaumcraftApi.addInfusionCraftingRecipe(String research,   // Research key
    Object result,        // ItemStack or Object[] of ItemStacks
    int instability,      // Instability ticks added per operation
    AspectList aspects,   // Essentia cost
    ItemStack input,     // Central item being crafted/transformed
    ItemStack[] recipe)   // Surrounding component items

Example

ThaumcraftApi.addInfusionCraftingRecipe(
    "INFUSION_RESEARCH",
    new ItemStack(Items.diamond_sword),
    10,                                              // instability
    new AspectList()
        .add(Aspect.FIRE, 25)
        .add(Aspect.WEAPON, 15),
    new ItemStack(Items.iron_sword),                 // central input
    new ItemStack[] {
        new ItemStack(Blocks.diamond_block),
        new ItemStack(Items.blaze_rod),
        new ItemStack(Items.ender_eye)
    });

InfusionRecipe Class

public class InfusionRecipe {
    protected AspectList aspects;
    protected String research;
    private ItemStack[] components;
    private ItemStack recipeInput;
    protected Object recipeOutput;
    protected int instability;
}

Constructor

public InfusionRecipe(String research, Object output, int instability,
        AspectList aspects, ItemStack input, ItemStack[] recipe)
Parameter Type Description
research String Research key required; empty string = no research
output Object ItemStack result or Object[] of possible results
instability int Instability added to the altar per craft
aspects AspectList Essentia cost
input ItemStack The central item in the infusion altar
recipe ItemStack[] Component items placed around the altar

Methods

Method Returns Description
matches(ArrayList<ItemStack> input, ItemStack central, World world, EntityPlayer player) boolean Checks if the recipe matches the current altar setup
getRecipeInput() ItemStack The central input item
getComponents() ItemStack[] Required surrounding components
getRecipeOutput() / getRecipeOutput(ItemStack input) Object Crafted result
getAspects() / getAspects(ItemStack input) AspectList Essentia cost
getInstability() / getInstability(ItemStack input) int Instability value
getResearch() String Required research key

Matching Logic

The matches method:

  1. Returns false if recipeInput is null
  2. Returns false if research is required but incomplete
  3. Checks if the central item matches recipeInput (fuzzy damage match allowed)
  4. Verifies all components are present in the altar’s input pool (fuzzy matching)
  5. Returns true only if all components are consumed exactly

Ore Dictionary entries in components match any item registered to that ore.

ItemStack Matching

public static boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy)
  • fuzzy=true: matches by Ore Dictionary ID
  • NBT tags must match (unless wildcard)
  • Damage value: exact match unless OreDictionary.WILDCARD_VALUE

Instability

Instability is a measure of how unstable the infusion altar becomes during crafting. Higher values cause more frequent and severe effects:

Instability Effect
0–5 Minor flux; occasional particles
6–15 Moderate effects; possible Rifts
16+ Severe effects; dangerous flux events

Mods can add stabilizers (candles, skulls, etc.) to reduce instability.

IInfusionStabiliser Interface

Blocks implementing this interface act as infusion stabilizers, reducing instability during crafting.

public interface IInfusionStabiliser {
    boolean canStabaliseInfusion(World world, int x, int y, int z);
}
Method Returns Description
canStabaliseInfusion boolean true if this block can stabilize the infusion altar at the given coordinates

Built-in Stabilizers

  • Candles (all variants)
  • skulls (all variants)
  • Pure Azure Feather

Registering a Stabilizer

// In your mod initialization
ThaumcraftApi.registerInfusionStabiliser(Block myBlock);

Finding Recipes

// Get InfusionRecipe by output ItemStack
InfusionRecipe recipe = ThaumcraftApi.getInfusionRecipe(ItemStack result);

// Iterate all infusion recipes
for (Object r : ThaumcraftApi.getCraftingRecipes()) {
    if (r instanceof InfusionRecipe) {
        InfusionRecipe ir = (InfusionRecipe) r;
        // ...
    }
}

Recipe Output as Object[]

The result parameter accepts Object[]. When getRecipeOutput() is called without an input argument, it returns the first element. When called with an input ItemStack, the recipe can return a different result based on the input item.