The title explains most of it for you.
I basically want a cursed crafting recipe
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?
52 Answers
How I have handled similar ideas:
- 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).
- Create an advancement that a player achieves either by crafting your custom recipe or by acquiring a bat_spawn_egg into their inventory.
- Set the reward of the advancement to trigger a custom function.
- Have the custom function remove the bat_spawn_egg from the player's inventory and add the cursed item with the NBT data.
Recipes in datapacks do not support NBT.
2