Crafting with Bags - SilentChaos512/Treasure-Bags GitHub Wiki

Introduction

Treasure Bags add a new ingredient type and two new recipe types (shaped and shapeless) to allow treasure bags to be used in recipes. These recipes extend the vanilla shaped and shapeless recipes, so their format is very similar and JEI can understand them. JEI can also tell different bag types apart.

Creating recipes for/using treasure bags is not required. It is an option you can use if you want to.

Matching Bag Types

Unfortunately, bag types are registered after ingredients and recipes, so these cannot verify that bag types are correct. Please double-check your spelling, as you will not see warnings in the log file. Invalid types will produce non-functioning recipes, or recipes that create invalid bags (these will not crash your game, they just won't work).

Ingredient

The treasure bag ingredient is type treasurebags:bag and has one property, bag_type, which is the bag type ID. The complete object would look something like this:

{
    "type": "treasurebags:bag",
    "bag_type": "treasurebags:default"
}

The example recipes below also use bag type ingredients.

Recipes

Both of these recipe types extend the vanilla shaped and shapeless recipes. The only change is the addition of the bag_type property in result (and type, of course).

Note these recipes will produce a warning in the log if the resulting item is not a treasure bag.

Shaped

{
    "type": "treasurebags:shaped_bag",
    "pattern": [
        "#",
        "/"
    ],
    "key": {
        "#": {
            "type": "treasurebags:bag",
            "bag_type": "treasurebags:default"
        },
        "/": {
            "tag": "forge:ingots/gold"
        }
    },
    "result": {
        "item": "treasurebags:treasure_bag",
        "bag_type": "treasurebags:test"
    }
}

Shapeless

{
    "type": "treasurebags:shapeless_bag",
    "ingredients": [
        {
            "type": "treasurebags:bag",
            "bag_type": "treasurebags:test"
        },
        {
            "item": "minecraft:clay_ball"
        }
    ],
    "result": {
        "item": "treasurebags:treasure_bag",
        "bag_type": "treasurebags:default"
    }
}