2

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?

5
  • 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
  • 5
    Possible duplicate of Does Minecraft 1.14.4 allow NBT tags in crafting recipes? – pppery Jun 21 '20 at 18:39
2

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.
3
  • Using a Bedrock block should work fine as well. There's still no way to obtain Bedrock outside of custom crafting recipes/loot tables, correct? Or even better, a command block. – Egor Hans Nov 20 '20 at 17:23
  • Another point: Normal crafting recipes can be repeated, while advancements cannot, correct? Better revoke it in the function. – Egor Hans Nov 20 '20 at 19:14
  • Oh, and if you try to craft something multiple times at once, it probably gives you only one item and wastes the rest, right? – Egor Hans Nov 20 '20 at 19:25
0

Recipes in datapacks do not support NBT.

2
  • 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

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