Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

Creating recipes with datapack

Li Junyu edited this page Jun 22, 2022 · 1 revision

Adding recipes to recipe map by datapack is now supported.

{
    "type": "multiblocked:multiblock",
    //The recipe map you want to assign to.
    "recipe_map": "recipe_map",
    "inputs": {
        //Specify capabilities by entry
        "item": [
            {
                //Follows how vanilla ingredients are serialized.
                "content": {
                    "item": "minecraft:apple",
                    "count": 1
                },
                "chance": 1.0
            },
            {
                "content": {
                    //Ingredients with stack count are also supported via
                    //a custom ingredient type.
                    "type": "multiblocked:sized",
                    "ingredient": {
                        "tag": "forge:ingots"
                    },
                    "count": 2
                }
            }
        ],
        "forge_energy": [
            {
                "content": 1000,
                "chance": 1.0
            }
        ]
    },
    //Same as inputs, empty entries can be left out
    "outputs": {},
    "tickInputs": {},
    "tickOutputs": {},
    //Conditions are serialized as how MBD serializes them.
    "recipeConditions": {
        "biome": {
            "biome": "minecraft:plains",
            "reverse": false
        },
        "block": {
            "block": "minecraft:grass",
            "reverse": false
        },
        "dimension": {
            "dimension": "minecraft:overworld",
            "reverse": false
        },
        "pos_y": {
            "min": 10,
            "max": 100,
            "reverse": false
        },
        "rain": {
            "level": 0.1,
            "reverse": false
        },
        "thunder": {
            "level": 0.1,
            "reverse": false
        }
    },
    //Recipe duration in ticks.
    "duration": 1,
    //Only translation key of the recipe will be synced.
    "text": "recipe.mbd.test_recipe.desc",
    //NBT for specifying special data
    "data": "{}"
}