1

The title explains most of it for you. I basically want a cursed crafting recipe cursed!

However, I want the resulting wooden pickaxe to be enchanted with sharpness (for absolutely no reason). I tried modifiying the .json file of the crafting recipe:

{
    "type": "minecraft:crafting_shaped",
    "pattern": [
        "///",
        " O ",
        " O "
    ],
    "key": {
        "/": {
            "item": "minecraft:stick"
        },
        "O": {
            "item": "minecraft:oak_planks"
        }
    },
    "result": {
        "item": "minecraft:wooden_pickaxe",
        "count": 1,
        "tag": {
            "enchantments": [
                {
                    "id":"minecraft:sharpness",
                    "lvl": 32767
                }
            ]
        }
    }
}

However, it still did not work.

Any ideas?

  • What's the behaviour of the game when you said "it still did not work"? – 54D Dec 5 '19 at 10:52
  • 1
    Custom crafting recipes don't support NBT. – MegaCrafter10 Dec 5 '19 at 12:56
  • When will they support NBT then? It still turned out as a wooden pickaxe. – HalpMe Dec 5 '19 at 13:08
  • They don't support NBT, which means you can't even do custom names? Also, can you change the amount of pick axes that comeout? If so, what happens when you craft, does it unstack? – Bruno Rodrigues Dec 5 '19 at 17:48
1

How I have handled similar ideas:

  1. Set the recipe's "result" to a particular item that a player is not likely to ever have in their inventory (I usually use bat_spawn_egg).
  2. Create an advancement that a player achieves either by crafting your custom recipe or by acquiring a bat_spawn_egg into their inventory.
  3. Set the reward of the advancement to trigger a custom function.
  4. Have the custom function remove the bat_spawn_egg from the player's inventory and add the cursed item with the NBT data.
0

Recipes in datapacks do not support NBT.

  • Could you add a way to do it or is it impossible? – Robbie Dec 5 '19 at 14:16
  • You can use one of the classic ways, like replacing items on the ground or in a chest. – Fabian Röling Dec 5 '19 at 15:59

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.