Those work like advancements:
There's a small mention about advancements in recipes section, but doesn't really help much. https://mcforge.readthedocs.io/en/latest/utilities/recipes/
gamepedia is more helpful in this case: https://minecraft.gamepedia.com/Advancements
EDIT: advancements json format: https://minecraft.gamepedia.com/Advancements/JSON_format
about advancement conditions: https://minecraft.gamepedia.com/Advancements/Conditions
to get you started you could use this as a template: it goes under src/main/resources/data/modid/advancements/recipes/item_name.json
{
"parent": "minecraft:recipes/root",
"requirements": [
[
"has_item",
"has_the_recipe"
]
],
"criteria": {
"has_item": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [
{
"tag": "forge:ingots/iron"
}
]
}
},
"has_the_recipe": {
"trigger": "minecraft:recipe_unlocked",
"conditions": {
"recipe": "modid:mod_item"
}
}
},
"rewards": {
"recipes": [
"modid:mod_item"
]
}
}