Result Target - WolfyScript/CustomCrafting-Wiki GitHub Wiki

With the Target feature, you can target specific ingredients of a recipe and use adapters to merge specific ItemMeta/NBT into the resulting ItemStack.

Everything works on a modular basis, which means you can select which adapters to use and you can even code and register your own adapters to merge custom nbt, etc.

How to use

There is no GUI for this feature as it is way too complex.
You need to edit your recipe JSON directly!

"result" : {
    "target" : {
      "mergeOptions" : [ {
        "slots" : [ 0 ],
        "adapters" : [ {
          "key" : "customcrafting:enchant"
        }, {
          "key" : "customcrafting:enchanted_book"
        } ]
      } ]
    },
    ...
  },

In the recipe config, you need to add the target field to your result.
Inside that target, you add the mergeOptions array field.

Now you are able to set as many MergeOptions as you want.
Each option consists of:
slots: Target specific slots of the recipe.
adapters: The adapters to use for the selected slots.

This example only targets the first ingredient of the recipe and will merge all the enchantments into the result. And if the ingredient is an Enchanted Book it will also do the same with the enchantments included in the book.