Add a callback: minetest.register_on_craft(itemstack, player, old_craft_grid, craft_inv)

This adds a callback when a player crafts something. The callback should return another itemstack, that would replace the original one, or nil, that will not change the itemstack.