Skip to content
This repository has been archived by the owner on Oct 9, 2024. It is now read-only.
KilaBash edited this page Aug 19, 2022 · 4 revisions

Adding Recipes

NOTE: This is only applies for Multiblocked in 1.18.2 (Version >= 0.8).

onEvent('recipes', event => {
    event.recipes.multiblocked.multiblock("coal")
        .inputItem(Item.of("diamond_axe").ignoreNBT())
        .inputItems("minecraft:diamond", "minecraft:apple")
        .inputFluid("minecraft:lava")
        .outputItem("apple")
        .outputFE(100)
        //Switch on the perTick/chance for incoming ingredients,
        //any ingredient will have perTick/chance applied as the
        //switch.
        .setChance(0.1)
        .setPerTick(true)
        .outputMana(100)
        .outputStress(100)
        .inputItem(Ingredient.of("#forge:rods").withCount(2))
        .setChance(1)
        .setPerTick(false)
        //All gas/infuse/pigment use a same set of input structure
        //.inputGas({ type: "mekanism:hydrogen", amount: 1000 })
        //Recipe conditions
        .thunder(1)
        .dimension("minecraft:nether")
        .biome("minecraft:plains")
        .yLevel(1, 10)
        //Text
        .text("sussy baka")
        //Data
        .data({ temperature: 1300 })
        .duration(100)
})

NOTE: This is only applies for outdated Multiblocked in 1.16.5 and 1.18.2 (Version < 0.8).

console.info('EBF Recipe Scripet')

let ebfDefinition = MbdRegistry.getDefinition("mbd:ebf");

let recipeMap;

if (ebfDefinition != null) { // two ways to get the recipeMap
    recipeMap = ebfDefinition.getRecipeMap();
} else {
    recipeMap = MbdRegistry.getRecipeMap("ebf");
}

if (recipeMap != null) {
    console.info('EBF RecipeMap Found');

    /* recipe builder demo*/
    /*
    recipeMap.start()
        .duration(100)
        .name("name") // have to set a unique name.
        .inputItems('3x minecraft:apple')
        .outputItems('3x minecraft:apple')
        .inputItems('3x minecraft:apple')
        .outputItems('3x minecraft:apple')
        .inputFE(1000)
        .outputFE(1000)
        .inputFluids('minecraft:water 100')
        .outputFluids('minecraft:water 100')
        .inputMana(200) // botania mana
        .outputMana(200)
        .inputHeat(105.5) // mekanism heat
        .outputHeat(105.5)
        .inputGases("mekanism:xxxx 100") // mekanism gas
        .outputGases("mekanism:xxxx 100")
        .inputPigments("mekanism:xxxx 100") // mekanism pigment
        .outputPigments("mekanism:xxxx 100")
        .inputInfusions("mekanism:xxxx 100") // mekanism infusion
        .outputInfusions("mekanism:xxxx 100")
        .inputSlurries("mekanism:xxxx 100") // mekanism slurry
        .outputSlurries("mekanism:xxxx 100")
        .inputs(MbdRegistry.getCapability("item"), "minecraft:apple") // for addons capability
        .outputs(MbdRegistry.getCapability("fluid"), "minecraft:water 100")
        .buildAndRegister();
        */


    recipeMap.start()
        .duration(100)
        .data("temperature", 1000) // add additional/custom data
        .text("T: §61000§rK") // add text info in JEI
        .name("r1") // have to set a unique name.
        .inputItems('3x minecraft:apple', 'minecraft:gold_ingot')
        .outputItems('minecraft:golden_apple')
        .buildAndRegister();

    recipeMap.start() // start always from chance == 1
        .duration(100)
        .data("temperature", 5000) // add additional/custom data
        .text("T: §65000§rK") // add text info in JEI
        .name("r2") // have to set a unique name.
        .perTick(true) // turn on perTick
        .inputItems('minecraft:sand') // sand will consume per tick
        .perTick(false) // turn off perTick
        .outputItems('minecraft:glass')
        .chance(0.5) // set the chance 50%
        .outputFluids('minecraft:lava 100') // product chance 50%
        .buildAndRegister();
} else {
    console.info('EBF RecipeMap Missing');
}