Adding Recipes using KubeJS - Yoghurt4C/BotaniaTweakers GitHub Wiki

  1. Navigate to data/modid/kubejs/ and create a javascript file, like mycooltweaker.js;
  2. Write events.listen('recipes', event => { } in. Now, you can start filling out entries inside that { }.

Before you go - this mod tries to process Ingredients and ItemStacks using its own syntax before using fallback. Here are some examples:

var coal = 'minecraft:coal'
var fourCoals = 'minecraft:coal * 4'
var fourTaggedCoals = 'minecraft:coal * 4 {tagged:1b}`
var taggedCoal = 'minecraft:coal {tagged:1b}`
var fourTaggedItemsFromTheCoalsTag = '#minecraft:coals * 4 {tagged:1b}` // when passed to an Ingredient, gets all items; when passed to an ItemStack, gets the first item from the tag

Brewing

event.recipes.botania.brew({
        id: 'brew_test', // String, specifies the "name" of the recipe - optional
        brew: 'botania:absorption', // String, specifies the output brew.
        ingredients: ['minecraft:apple', 'minecraft:iron_ingot', 'minecraft:rotten_flesh'] // Ingredient[], specifies the inputs.
    })
    // "Compact" argument-based syntax. The first argument is optional. Functionally identical to the above method.
    event.recipes.botania.brew('brew_test', 'botania:absorption', ['minecraft:golden_apple * 5', 'minecraft:iron_ingot * 2 {tag:1b}', 'minecraft:rotten_flesh'])

Elven Trade

event.recipes.botania.elven_trade({
        id: 'trade_test', // String, specifies the name of the recipe - optional
        output: ['minecraft:apple'], // ItemStack[], specifies the outputs.
        ingredients: ['minecraft:carrot', 'minecraft:carrot'] // Ingredient[], specifies the inputs.
    })
    // "Compact" argument-based syntax. The first argument is optional. Functionally identical to the above method. As of 12/8/2020, KubeJS can't handle NBT, so just ignore it for now.
    event.recipes.botania.elven_trade('trade_arg_test', ['botania:tiny_potato * 4 {display: {Name: \'{"text":"pahimar"}\'}}'], ['minecraft:potato', 'minecraft:potato'])

Mana Infusion

event.recipes.botania.mana_infusion({
        id: 'infusion_test', //String, specifies the "name" of the recipe - optional
        output: 'minecraft:gold_block', //ItemStack, specifies the output.
        input: 'minecraft:brick', //Ingredient, specifies the input.
        mana: 500, // int, specifies the amount of mana drained from the pool for crafting to succeed.
        catalyst: 'minecraft:bricks', // BlockState, specifies the block that must be present under the mana pool for this recipe to work - optional
        group: 'botania:flower_cycle' // String, specifies the recipe group this recipe belongs to. I can't imagine why you'd ever use this - optional
    })
    // "Compact" argument-based syntax. The first, fifth and sixth arguments are optional - but the sixth requires the 5th to be present. Functionally identical to the above method.
    event.recipes.botania.mana_infusion('infusion_arg_test', 'minecraft:diamond_block', 'minecraft:brick', 1000, 'minecraft:gold_block')
    // valid arg-based entry
    event.recipes.botania.mana_infusion('minecraft:diamond_block', 'minecraft:brick', 1000, null, 'botania:flower_cycle')

Petal Apothecary

event.recipes.botania.petal_apothecary({
        id: 'apothecary_test', // String, specifies the "name" of the recipe - optional
        output: 'minecraft:clay_ball', // ItemStack, specifies the output
        ingredients: ['minecraft:iron_ingot', 'minecraft:gold_ingot'] // Ingredient[], specifies the inputs
    })
    // "Compact" argument-based syntax. The first argument is optional. Functionally identical to the above method.
    event.recipes.botania.petal_apothecary('apothecary_arg_test', 'minecraft:diamond', ['minecraft:clay_ball', 'minecraft:clay_ball'])

Pure Daisy

event.recipes.botania.pure_daisy({
        id: 'daisy_test', // String, specifies the "name" of the recipe - optional
        output: {
            name: 'minecraft:coarse_dirt' // mandatory JsonObject
        },
        input: {
            type: 'block', //object type, can be "block", "state", "blocks" or "tag"
            block: 'minecraft:coal_ore' //input state itself - this property name should be the same as the one specified in "type"
        },
        time: 20 // int, specifies the amount of ticks a blockspace has to receive to convert into the output state - optional
    })
    // "Compact" argument-based syntax. The first and fourth arguments are optional. Functionally identical to the above method.
    event.recipes.botania.pure_daisy('daisy_arg_test', 'minecraft:gold_ore', 'minecraft:bricks', 80)

Runic Altar

event.recipes.botania.runic_altar({
        id: 'altar_test', // String, specifies the "name" of the recipe - optional
        output: 'minecraft:clay_ball', // ItemStack, specifies the output
        ingredients: ['minecraft:feather', 'minecraft:feather'], // Ingredient[], specifies the inputs
        mana: 3000 // int, specifies the amount of mana received from spreaders for crafting to succeed.
    })
    // "Compact" argument-based syntax. The first argument is optional. Functionally identical to the above method.
    event.recipes.botania.runic_altar('loomy', 'minecraft:feather', ['minecraft:clay_ball','minecraft:clay_ball'], 500)

Terrestrial Agglomeration Plate

event.recipes.botania.terra_plate({
        id: 'all_the_mana_is_gone', // String, specifies the "name" of the recipe - optional
        result: 'minecraft:clay_ball', // ItemStack, specifies the output
        ingredients: ['minecraft:diamond','botania:tiny_potato'], // Ingredient[], specifies the inputs
        mana: 1500000 // int, specifies the amount of mana drained from nearby pools through sparks for crafting to succeed.
    })
    // "Compact" argument-based syntax. The first argument is optional. Functionally identical to the above method.
    event.recipes.botania.terra_plate('terra_plate_arg_test', 'minecraft:golden_apple*10', ['minecraft:potato','minecraft:golden_carrot'], 1500)