Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Prototype Docs Version 2.0.77

# RecipePrototype - Prototype Docs

## RecipePrototype 'recipe' Example code

A recipe. It can be a crafting recipe, a smelting recipe, or a custom type of recipe, see RecipeCategory.

Inherits from Prototype « PrototypeBase

## Properties

- default
- sorted

category optional | :: RecipeCategoryID | The category of this recipe. [...]
The category of this recipe. [...]
additional_categories optional | :: array[RecipeCategoryID] |
crafting_machine_tint optional | :: RecipeTints | Used by WorkingVisualisations::working_visualisations to tint certain layers with the recipe color. [...]
Used by WorkingVisualisations::working_visualisations to tint certain layers with the recipe color. [...]
icons optional | :: array[IconData] | Can't be an empty array.
Can't be an empty array.
icon optional | :: FileName | If given, this determines the recipe's icon. [...]
If given, this determines the recipe's icon. [...]
icon_size optional | :: SpriteSizeType | The size of the square icon, in pixels. [...]
The size of the square icon, in pixels. [...]
ingredients optional | :: array[IngredientPrototype] | A table containing ingredient names and amounts. [...]
A table containing ingredient names and amounts. [...]
results optional | :: array[ProductPrototype] | A table containing result names and amounts. [...]
A table containing result names and amounts. [...]
main_product optional | :: string | For recipes with one or more products: Subgroup, localised_name and icon default to the values of the singular/main product, but can be overwritten by the recipe. [...]
For recipes with one or more products: Subgroup, localised_name and icon default to the values of the singular/main product, but can be overwritten by the recipe. [...]
energy_required optional | :: double | The amount of time it takes to make this recipe. [...]
The amount of time it takes to make this recipe. [...]
emissions_multiplier optional | :: double |
maximum_productivity optional | :: double | Must be >= 0.
Must be >= 0.
requester_paste_multiplier optional | :: uint32 |
overload_multiplier optional | :: uint32 | Used to determine how many extra items are put into an assembling machine before it's considered "full enough". [...]
Used to determine how many extra items are put into an assembling machine before it's considered "full enough". [...]
allow_inserter_overload optional | :: boolean | Whether the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size).
Whether the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size).
enabled optional | :: boolean | This can be `false` to disable the recipe at the start of the game, or `true` to leave it enabled. [...]
This can be `false` to disable the recipe at the start of the game, or `true` to leave it enabled. [...]
hide_from_stats optional | :: boolean | Hides the recipe from item/fluid production statistics.
Hides the recipe from item/fluid production statistics.
hide_from_player_crafting optional | :: boolean | Hides the recipe from the player's crafting screen. [...]
Hides the recipe from the player's crafting screen. [...]
hide_from_bonus_gui optional | :: boolean |
allow_decomposition optional | :: boolean | Whether this recipe is allowed to be broken down for the recipe tooltip "Total raw" calculations.
Whether this recipe is allowed to be broken down for the recipe tooltip "Total raw" calculations.
allow_as_intermediate optional | :: boolean | Whether the recipe can be used as an intermediate recipe in hand-crafting.
Whether the recipe can be used as an intermediate recipe in hand-crafting.
allow_intermediates optional | :: boolean | Whether the recipe is allowed to use intermediate recipes when hand-crafting.
Whether the recipe is allowed to use intermediate recipes when hand-crafting.
always_show_made_in optional | :: boolean | Whether the "Made in: " part of the tool-tip should always be present, and not only when the recipe can't be hand-crafted.
Whether the "Made in: " part of the tool-tip should always be present, and not only when the recipe can't be hand-crafted.
show_amount_in_title optional | :: boolean | Whether the recipe name should have the product amount in front of it. [...]
Whether the recipe name should have the product amount in front of it. [...]
always_show_products optional | :: boolean | Whether the products are always shown in the recipe tooltip.
Whether the products are always shown in the recipe tooltip.
unlock_results optional | :: boolean | Whether enabling this recipe unlocks its item products to show in selection lists (item filters, logistic requests, etc.).
Whether enabling this recipe unlocks its item products to show in selection lists (item filters, logistic requests, etc.).
preserve_products_in_machine_output optional | :: boolean |
result_is_always_fresh optional | :: boolean | When set to true, the recipe will always produce fresh (non-spoiled) item even when the ingredients are spoiled.
When set to true, the recipe will always produce fresh (non-spoiled) item even when the ingredients are spoiled.
reset_freshness_on_craft optional | :: boolean | When set to true, if the recipe successfully finishes crafting without spoiling, the result is produced fresh (non-spoiled).
When set to true, if the recipe successfully finishes crafting without spoiling, the result is produced fresh (non-spoiled).
allow_consumption_message optional | :: LocalisedString |
allow_speed_message optional | :: LocalisedString |
allow_productivity_message optional | :: LocalisedString |
allow_pollution_message optional | :: LocalisedString |
allow_quality_message optional | :: LocalisedString |
surface_conditions optional | :: array[SurfaceCondition] |
hide_from_signal_gui optional | :: boolean | If left unset, this property will be determined automatically: If the recipe is not `hidden`, and no item, fluid, or virtual signal has the same icon as this recipe, this property will be set to `false`. [...]
If left unset, this property will be determined automatically: If the recipe is not `hidden`, and no item, fluid, or virtual signal has the same icon as this recipe, this property will be set to `false`. [...]
allow_consumption optional | :: boolean |
allow_speed optional | :: boolean |
allow_productivity optional | :: boolean |
allow_pollution optional | :: boolean |
allow_quality optional | :: boolean |
allowed_module_categories optional | :: array[ModuleCategoryID] | Sets the module categories that are allowed to be used with this recipe.
Sets the module categories that are allowed to be used with this recipe.
alternative_unlock_methods optional | :: array[TechnologyID] | Additional technologies to list under "Unlocked by" on a recipe's Factoriopedia page.
Additional technologies to list under "Unlocked by" on a recipe's Factoriopedia page.
auto_recycle optional | :: boolean | Whether the recipe should be included in the recycling recipes automatically generated by the quality mod. [...]
Whether the recipe should be included in the recycling recipes automatically generated by the quality mod. [...]

Inherited from Prototype

factoriopedia_alternative optional | :: string | The ID type corresponding to the prototype that inherits from this. [...]
The ID type corresponding to the prototype that inherits from this. [...]
custom_tooltip_fields optional | :: array[CustomTooltipField] | Allows to add extra description items to the tooltip and Factoriopedia.
Allows to add extra description items to the tooltip and Factoriopedia.

Inherited from PrototypeBase

type | :: string | Specifies the kind of prototype this is. [...]
Specifies the kind of prototype this is. [...]
name | :: string | Unique textual identification of the prototype. [...]
Unique textual identification of the prototype. [...]
order optional | :: Order | Used to order prototypes in inventory, recipes and GUIs. [...]
Used to order prototypes in inventory, recipes and GUIs. [...]
localised_name optional | :: LocalisedString | Overwrites the name set in the locale file. [...]
Overwrites the name set in the locale file. [...]
localised_description optional | :: LocalisedString | Overwrites the description set in the locale file. [...]
Overwrites the description set in the locale file. [...]
factoriopedia_description optional | :: LocalisedString | Provides additional description used in factoriopedia.
Provides additional description used in factoriopedia.
subgroup optional | :: ItemSubGroupID | The name of an ItemSubGroup.
The name of an ItemSubGroup.
hidden[overridden] optional | :: boolean | Hides the recipe from crafting menus and other recipe selection lists.
Hides the recipe from crafting menus and other recipe selection lists.
hidden_in_factoriopedia optional | :: boolean |
parameter optional | :: boolean | Whether the prototype is a special type which can be used to parametrize blueprints and doesn't have other function.
Whether the prototype is a special type which can be used to parametrize blueprints and doesn't have other function.
factoriopedia_simulation optional | :: SimulationDefinition | The simulation shown when looking at this prototype in the Factoriopedia GUI.
The simulation shown when looking at this prototype in the Factoriopedia GUI.

additional_categories optional | :: array[RecipeCategoryID] |
allow_as_intermediate optional | :: boolean | Whether the recipe can be used as an intermediate recipe in hand-crafting.
Whether the recipe can be used as an intermediate recipe in hand-crafting.
allow_consumption optional | :: boolean |
allow_consumption_message optional | :: LocalisedString |
allow_decomposition optional | :: boolean | Whether this recipe is allowed to be broken down for the recipe tooltip "Total raw" calculations.
Whether this recipe is allowed to be broken down for the recipe tooltip "Total raw" calculations.
allow_inserter_overload optional | :: boolean | Whether the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size).
Whether the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size).
allow_intermediates optional | :: boolean | Whether the recipe is allowed to use intermediate recipes when hand-crafting.
Whether the recipe is allowed to use intermediate recipes when hand-crafting.
allow_pollution optional | :: boolean |
allow_pollution_message optional | :: LocalisedString |
allow_productivity optional | :: boolean |
allow_productivity_message optional | :: LocalisedString |
allow_quality optional | :: boolean |
allow_quality_message optional | :: LocalisedString |
allow_speed optional | :: boolean |
allow_speed_message optional | :: LocalisedString |
allowed_module_categories optional | :: array[ModuleCategoryID] | Sets the module categories that are allowed to be used with this recipe.
Sets the module categories that are allowed to be used with this recipe.
alternative_unlock_methods optional | :: array[TechnologyID] | Additional technologies to list under "Unlocked by" on a recipe's Factoriopedia page.
Additional technologies to list under "Unlocked by" on a recipe's Factoriopedia page.
always_show_made_in optional | :: boolean | Whether the "Made in: " part of the tool-tip should always be present, and not only when the recipe can't be hand-crafted.
Whether the "Made in: " part of the tool-tip should always be present, and not only when the recipe can't be hand-crafted.
always_show_products optional | :: boolean | Whether the products are always shown in the recipe tooltip.
Whether the products are always shown in the recipe tooltip.
auto_recycle optional | :: boolean | Whether the recipe should be included in the recycling recipes automatically generated by the quality mod. [...]
Whether the recipe should be included in the recycling recipes automatically generated by the quality mod. [...]
category optional | :: RecipeCategoryID | The category of this recipe. [...]
The category of this recipe. [...]
crafting_machine_tint optional | :: RecipeTints | Used by WorkingVisualisations::working_visualisations to tint certain layers with the recipe color. [...]
Used by WorkingVisualisations::working_visualisations to tint certain layers with the recipe color. [...]
emissions_multiplier optional | :: double |
enabled optional | :: boolean | This can be `false` to disable the recipe at the start of the game, or `true` to leave it enabled. [...]
This can be `false` to disable the recipe at the start of the game, or `true` to leave it enabled. [...]
energy_required optional | :: double | The amount of time it takes to make this recipe. [...]
The amount of time it takes to make this recipe. [...]
hide_from_bonus_gui optional | :: boolean |
hide_from_player_crafting optional | :: boolean | Hides the recipe from the player's crafting screen. [...]
Hides the recipe from the player's crafting screen. [...]
hide_from_signal_gui optional | :: boolean | If left unset, this property will be determined automatically: If the recipe is not `hidden`, and no item, fluid, or virtual signal has the same icon as this recipe, this property will be set to `false`. [...]
If left unset, this property will be determined automatically: If the recipe is not `hidden`, and no item, fluid, or virtual signal has the same icon as this recipe, this property will be set to `false`. [...]
hide_from_stats optional | :: boolean | Hides the recipe from item/fluid production statistics.
Hides the recipe from item/fluid production statistics.
icon optional | :: FileName | If given, this determines the recipe's icon. [...]
If given, this determines the recipe's icon. [...]
icon_size optional | :: SpriteSizeType | The size of the square icon, in pixels. [...]
The size of the square icon, in pixels. [...]
icons optional | :: array[IconData] | Can't be an empty array.
Can't be an empty array.
ingredients optional | :: array[IngredientPrototype] | A table containing ingredient names and amounts. [...]
A table containing ingredient names and amounts. [...]
main_product optional | :: string | For recipes with one or more products: Subgroup, localised_name and icon default to the values of the singular/main product, but can be overwritten by the recipe. [...]
For recipes with one or more products: Subgroup, localised_name and icon default to the values of the singular/main product, but can be overwritten by the recipe. [...]
maximum_productivity optional | :: double | Must be >= 0.
Must be >= 0.
overload_multiplier optional | :: uint32 | Used to determine how many extra items are put into an assembling machine before it's considered "full enough". [...]
Used to determine how many extra items are put into an assembling machine before it's considered "full enough". [...]
preserve_products_in_machine_output optional | :: boolean |
requester_paste_multiplier optional | :: uint32 |
reset_freshness_on_craft optional | :: boolean | When set to true, if the recipe successfully finishes crafting without spoiling, the result is produced fresh (non-spoiled).
When set to true, if the recipe successfully finishes crafting without spoiling, the result is produced fresh (non-spoiled).
result_is_always_fresh optional | :: boolean | When set to true, the recipe will always produce fresh (non-spoiled) item even when the ingredients are spoiled.
When set to true, the recipe will always produce fresh (non-spoiled) item even when the ingredients are spoiled.
results optional | :: array[ProductPrototype] | A table containing result names and amounts. [...]
A table containing result names and amounts. [...]
show_amount_in_title optional | :: boolean | Whether the recipe name should have the product amount in front of it. [...]
Whether the recipe name should have the product amount in front of it. [...]
surface_conditions optional | :: array[SurfaceCondition] |
unlock_results optional | :: boolean | Whether enabling this recipe unlocks its item products to show in selection lists (item filters, logistic requests, etc.).
Whether enabling this recipe unlocks its item products to show in selection lists (item filters, logistic requests, etc.).

Inherited from Prototype

custom_tooltip_fields optional | :: array[CustomTooltipField] | Allows to add extra description items to the tooltip and Factoriopedia.
Allows to add extra description items to the tooltip and Factoriopedia.
factoriopedia_alternative optional | :: string | The ID type corresponding to the prototype that inherits from this. [...]
The ID type corresponding to the prototype that inherits from this. [...]

Inherited from PrototypeBase

name | :: string | Unique textual identification of the prototype. [...]
Unique textual identification of the prototype. [...]
type | :: string | Specifies the kind of prototype this is. [...]
Specifies the kind of prototype this is. [...]
factoriopedia_description optional | :: LocalisedString | Provides additional description used in factoriopedia.
Provides additional description used in factoriopedia.
factoriopedia_simulation optional | :: SimulationDefinition | The simulation shown when looking at this prototype in the Factoriopedia GUI.
The simulation shown when looking at this prototype in the Factoriopedia GUI.
hidden[overridden] optional | :: boolean | Hides the recipe from crafting menus and other recipe selection lists.
Hides the recipe from crafting menus and other recipe selection lists.
hidden_in_factoriopedia optional | :: boolean |
localised_description optional | :: LocalisedString | Overwrites the description set in the locale file. [...]
Overwrites the description set in the locale file. [...]
localised_name optional | :: LocalisedString | Overwrites the name set in the locale file. [...]
Overwrites the name set in the locale file. [...]
order optional | :: Order | Used to order prototypes in inventory, recipes and GUIs. [...]
Used to order prototypes in inventory, recipes and GUIs. [...]
parameter optional | :: boolean | Whether the prototype is a special type which can be used to parametrize blueprints and doesn't have other function.
Whether the prototype is a special type which can be used to parametrize blueprints and doesn't have other function.
subgroup optional | :: ItemSubGroupID | The name of an ItemSubGroup.
The name of an ItemSubGroup.

## Properties

### category :: RecipeCategoryID optional

Default: `"crafting"`

The category of this recipe. Controls which machines can craft this recipe.

The built-in categories can be found here. The base `"crafting"` category can not contain recipes with fluid ingredients or products.

#### Example

    category = "smelting"

### additional_categories :: array[RecipeCategoryID] optional

### crafting_machine_tint :: RecipeTints optional

Used by WorkingVisualisations::working_visualisations to tint certain layers with the recipe color. WorkingVisualisation::apply_recipe_tint determines which of the four colors is used for that layer, if any.

### icons :: array[IconData] optional

Can't be an empty array.

### icon :: FileName optional

If given, this determines the recipe's icon. Otherwise, the icon of `main_product` or the singular product is used.

Only loaded if `icons` is not defined.

Mandatory if `icons` is not defined for a recipe with more than one product and no `main_product`, or no product.

#### Example

    icon = "__base__/graphics/icons/fluid/heavy-oil.png"

### icon_size :: SpriteSizeType optional

Default: `64`

The size of the square icon, in pixels. E.g. `32` for a 32px by 32px icon. Must be larger than `0`.

Only loaded if `icons` is not defined.

### ingredients :: array[IngredientPrototype] optional

A table containing ingredient names and amounts. Can also contain information about fluid temperature and whether some of the amount is ignored by production statistics.

Can be set to an empty table to create a recipe that needs no ingredients. Assembling machines do not support recipes with more than 65 535 different item ingredients.

Duplicate ingredients, e.g. two entries with the same name, are not allowed. In-game, the item ingredients are ordered by ItemGroup::order_in_recipe.

#### Examples

    -- Recipe with items
    ingredients =
    {
      {type = "item", name = "iron-stick", amount = 2},
      {type = "item", name = "iron-plate", amount = 3}
    }

    -- Recipe with fluids
    ingredients =
    {
      {type = "fluid", name = "water", amount = 50},
      {type = "fluid", name = "crude-oil", amount = 100}
    }

### results :: array[ProductPrototype] optional

A table containing result names and amounts. Products also contain information such as fluid temperature, probability of results and whether some of the amount is ignored by productivity.

Can be set to an empty table to create a recipe that produces nothing. Assembling machines do not support recipes with more than 65 535 different item products.

Duplicate results, e.g. two entries with the same name, are allowed.

#### Examples

    results =
    {
      {type = "fluid", name= "heavy-oil", amount = 3},
      {type = "fluid", name= "light-oil", amount = 3},
      {type = "fluid", name= "petroleum-gas", amount = 4}
    }

    results =
    {
      {type = "item", name = "iron-plate", amount = 9},
      {type = "item", name = "copper-plate", amount = 1}
    }

    results = {{type = "fluid", name = "steam", amount = 1, temperature = 165}}

### main_product :: string optional

For recipes with one or more products: Subgroup, localised_name and icon default to the values of the singular/main product, but can be overwritten by the recipe. Setting the main_product to an empty string (`""`) forces the title in the recipe tooltip to use the recipe's name (not that of the product) and shows the products in the tooltip.

If 1) there are multiple products and this property is nil, 2) this property is set to an empty string (`""`), or 3) there are no products, the recipe will use the localised_name, icon, and subgroup of the recipe. icon and subgroup become non-optional.

### energy_required :: double optional

Default: `0.5`

The amount of time it takes to make this recipe. Must be `> 0.001`. Equals the number of seconds it takes to craft at crafting speed `1`.

### emissions_multiplier :: double optional

Default: `1`

### maximum_productivity :: double optional

Default: `3.0`

Must be >= 0.

### requester_paste_multiplier :: uint32 optional

Default: `30`

### overload_multiplier :: uint32 optional

Default: `0`

Used to determine how many extra items are put into an assembling machine before it's considered "full enough". See insertion limits.

If set to `0`, it instead uses the following formula: `1.166 / (energy_required / the assembler's crafting_speed)`, rounded up, and clamped to be between`2` and `100`. The numbers used in this formula can be changed by the UtilityConstants properties `dynamic_recipe_overload_factor`, `minimum_recipe_overload_multiplier`, and `maximum_recipe_overload_multiplier`.

### allow_inserter_overload :: boolean optional

Default: `true`

Whether the recipe is allowed to have the extra inserter overload bonus applied (4 * stack inserter stack size).

### enabled :: boolean optional

Default: `true`

This can be `false` to disable the recipe at the start of the game, or `true` to leave it enabled.

If a recipe is unlocked via technology, this should be set to `false`.

### hide_from_stats :: boolean optional

Default: `false`

Hides the recipe from item/fluid production statistics.

### hide_from_player_crafting :: boolean optional

Default: `false`

Hides the recipe from the player's crafting screen. The recipe will still show up for selection in machines.

### hide_from_bonus_gui :: boolean optional

Default: `false`

### allow_decomposition :: boolean optional

Default: `true`

Whether this recipe is allowed to be broken down for the recipe tooltip "Total raw" calculations.

### allow_as_intermediate :: boolean optional

Default: `true`

Whether the recipe can be used as an intermediate recipe in hand-crafting.

### allow_intermediates :: boolean optional

Default: `true`

Whether the recipe is allowed to use intermediate recipes when hand-crafting.

### always_show_made_in :: boolean optional

Default: `false`

Whether the "Made in: " part of the tool-tip should always be present, and not only when the recipe can't be hand-crafted.

### show_amount_in_title :: boolean optional

Default: `true`

Whether the recipe name should have the product amount in front of it. E.g. "2x Transport belt".

### always_show_products :: boolean optional

Default: `false`

Whether the products are always shown in the recipe tooltip.

### unlock_results :: boolean optional

Default: `true`

Whether enabling this recipe unlocks its item products to show in selection lists (item filters, logistic requests, etc.).

### preserve_products_in_machine_output :: boolean optional

Default: `false`

### result_is_always_fresh :: boolean optional

Default: `false`

When set to true, the recipe will always produce fresh (non-spoiled) item even when the ingredients are spoiled.

### reset_freshness_on_craft :: boolean optional

Default: `false`

When set to true, if the recipe successfully finishes crafting without spoiling, the result is produced fresh (non-spoiled).

### allow_consumption_message :: LocalisedString optional

Default: `{"item-limitation.consumption-effect"}`

### allow_speed_message :: LocalisedString optional

Default: `{"item-limitation.speed-effect"}`

### allow_productivity_message :: LocalisedString optional

Default: `{"item-limitation.productivity-effect"}`

### allow_pollution_message :: LocalisedString optional

Default: `{"item-limitation.pollution-effect"}`

### allow_quality_message :: LocalisedString optional

Default: `{"item-limitation.quality-effect"}`

### surface_conditions :: array[SurfaceCondition] optional

### hide_from_signal_gui :: boolean optional

If left unset, this property will be determined automatically: If the recipe is not `hidden`, and no item, fluid, or virtual signal has the same icon as this recipe, this property will be set to `false`. It'll be `true` otherwise.

### allow_consumption :: boolean optional

Default: `true`

### allow_speed :: boolean optional

Default: `true`

### allow_productivity :: boolean optional

Default: `false`

### allow_pollution :: boolean optional

Default: `true`

### allow_quality :: boolean optional

Default: `true`

### allowed_module_categories :: array[ModuleCategoryID] optional

Default: All module categories are allowed

Sets the module categories that are allowed to be used with this recipe.

### alternative_unlock_methods :: array[TechnologyID] optional

Additional technologies to list under "Unlocked by" on a recipe's Factoriopedia page.

### auto_recycle :: boolean optional

Default: `true`

Whether the recipe should be included in the recycling recipes automatically generated by the quality mod.

This property is not read by the game engine itself, but the quality mod's recycling.lua file. This means it is discarded by the game engine after loading finishes.

## Overridden Properties

### hidden :: boolean optional

Default: `false`

Hides the recipe from crafting menus and other recipe selection lists.

## Examples

    {
      type = "recipe",
      name = "iron-plate",
      category = "smelting",
      energy_required = 3.5,
      ingredients = {{type = "item", name = "iron-ore", amount = 1}},
      results = {{type = "item", name = "iron-plate", amount = 1}}
    }

    {
      type = "recipe",
      name = "coal-liquefaction",
      category = "oil-processing",
      subgroup = "fluid-recipes",
      order = "a[oil-processing]-c[coal-liquefaction]",
      enabled = false,
      energy_required = 5,
      icon = "__base__/graphics/icons/fluid/coal-liquefaction.png",
      icon_size = 32,
      ingredients =
      {
        {type = "item", name = "coal", amount = 10},
        {type = "fluid", name = "heavy-oil", amount = 25},
        {type = "fluid", name = "steam", amount = 50}
      },
      results=
      {
        {type = "fluid", name = "heavy-oil", amount = 35},
        {type = "fluid", name = "light-oil", amount = 15},
        {type = "fluid", name = "petroleum-gas", amount = 20}
      },
      allow_decomposition = false
    }