Currently, datapacks' recipes aren't useful for crafting partiality-custom items added by datapacks. There are suggestions to implement support for NBT data in input and output items. However, accessing items' NBT data may affect performance and in some cases, not flexible enough. Therefore, I suggest that we should be able to use predicates to specify conditions to input items and use item modifiers to modify the output item. I prefer item modifiers to loot tables entries because loot table entries can produce random items, which may cause problems when displaying in the sidebar of crafting GUI. A recipe is craftable only when all predicates specified in ingredients pass. This method would not only allow NBT data checking and applying, but also open more possibilities which are hard or impossible to achieve with only NBT tags. Some predicate and item modifier types could be disabled if they weren't suitable for crafting context. "predicate" and "modifier" fields could be resource locations to corresponding files in a datapack. Here is an example recipe representing this idea:
{ "type": "minecraft:crafting_shaped", "pattern": [ " # ", "#X#", " # " ], "key": { "#": { "item": "minecraft:iron_ingot", "predicate": "mypack:is_ender_ingot" }, "X": { "item": "minecraft:redstone" } }, "result": { "item": "minecraft:compass" "modifier" : "mypack:stronghold_compass" } }
Please sign in to leave a comment.
0 Comments