0
\$\begingroup\$

I'm creating a Minecraft mod with Forge, and I need to create a custom crafting recipe that uses cocoa beans. However, when I try to create the recipe, it does not work (as in, I cannot craft items with the specified pattern).

When src/main/resources/assets/mymod/recipes/myrecipe.json looks like this, it works fine:

{
    "type": "minecraft:crafting_shaped",

    "pattern": [
        " X ",
        " X ",
        " X "
    ],

    "key": {
        "X": {
            "item": "minecraft:iron_ingot"
        }
    },

    "result": {
        "item": "minecraft:gold_ingot",
        "count": 1
    }
}

but when it looks like this, I can't craft items with the recipe:

{
    "type": "minecraft:crafting_shaped",

    "pattern": [
        " X ",
        " X ",
        " X "
    ],

    "key": {
        "X": {
            "item": "minecraft:cocoa_beans"
        }
    },

    "result": {
        "item": "minecraft:gold_ingot",
        "count": 1
    }
}

According to https://minecraft.gamepedia.com/Cocoa_Beans#ID, the name ID for cocoa beans is minecraft:cocoa_beans, which is exactly what I entered. However, the crafting recipe does not seem to be loaded into the game.

Why isn't the second crafting recipe working and how can I fix it?

I'm using Forge version 1.12.2-14.23.5.2768 and Eclipse version 2018-09 (4.9.0), and I'm running Minecraft directly from Eclipse.

| improve this question | | | | |
\$\endgroup\$
1
\$\begingroup\$

Coco beans are brown dye.

Dye has metadata values that determine which specific item it is (until 1.13 and The Flattening). The data value you're looking for in this case, is 3.

"key": {
    "X": {
        "item": "minecraft:dye",
        "data": 3
    }
},
| improve this answer | | | | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.