# Recipes

Shared fields and authoring guides for NTM recipes.

NTM recipe files live under `data/<namespace>/recipe/<path>.json`. See the [Minecraft Wiki data pack reference](https://minecraft.wiki/w/Data_pack) for vanilla recipe formats; this page covers NTM recipe fields and behavior.

Start with a bundled file of the same type from your installed mod jar. Machine recipe types add fields and interpret outputs differently.

## Guides

- [Item inputs and outputs](https://movblock.mov/ntm-next/wiki/recipes/items.md)
- [Fixed grids](https://movblock.mov/ntm-next/wiki/recipes/fixed-grids.md)
- [Fluid entries](https://movblock.mov/ntm-next/wiki/recipes/fluids.md)
- [Duration, power and ordering](https://movblock.mov/ntm-next/wiki/recipes/timing.md)
- [Recipe conditions](https://movblock.mov/ntm-next/wiki/recipes/conditions.md)
- [Item-tag result](https://movblock.mov/ntm-next/wiki/recipes/tag-result.md)
- [Material distribution](https://movblock.mov/ntm-next/wiki/recipes/material-distribution.md)
- [Container upgrade](https://movblock.mov/ntm-next/wiki/recipes/container-upgrade.md)
- [RBMK fuel disassembly](https://movblock.mov/ntm-next/wiki/recipes/rbmk-fuel-disassembly.md)
- [Duct retyping](https://movblock.mov/ntm-next/wiki/recipes/duct-retype.md)
- [Duct untyping](https://movblock.mov/ntm-next/wiki/recipes/duct-untype.md)
- [MKUNICORN crafting](https://movblock.mov/ntm-next/wiki/recipes/mku.md)
- [Grenade assembly](https://movblock.mov/ntm-next/wiki/recipes/grenade-assembly.md)
- [Cargo shell loading](https://movblock.mov/ntm-next/wiki/recipes/cargo-shell.md)

> **since NTM 1.0.1**
>
> - [Shaped crafting](https://movblock.mov/ntm-next/wiki/recipes/crafting-shaped.md)
> - [Shapeless crafting](https://movblock.mov/ntm-next/wiki/recipes/crafting-shapeless.md)
> - [Crafting input state](https://movblock.mov/ntm-next/wiki/recipes/input-state.md)
> - [Scrap splitting](https://movblock.mov/ntm-next/wiki/recipes/scraps-split.md)

## Recipe identifiers

| Name | Example | Meaning |
| - | - | - |
| Recipe resource ID | `hbm:custom_machine/custom_machine.paper_press` | Identifies the JSON resource and determines which file an override replaces |
| Recipe `type` | `hbm:custom_machine` | Selects the recipe parser and machine recipe table |
| Custom-machine `recipe_key` | `paperPress` | Connects custom-machine definitions to their process recipes |
| Recipe `name` | `custom_machine.paper_press` | Internal lookup name; defaults to the last segment of the resource path |

Internal names must be unique within a recipe table. Different resource IDs can produce the same default name; a lookup by that name reaches one row.

## Shared fields

The [machine recipe reference](https://movblock.mov/ntm-next/wiki/recipe-types.md) gives each machine its recipe formats and examples.

| Field | Meaning and default | Range |
| - | - | - |
| `type` | Selects the recipe format. | |
| `name` (Optional) | Internal lookup name; defaults to the last segment of the recipe resource path. | |
| `input_items` (Optional) | Ordered counted item inputs; defaults to an empty list. | |
| `input_items.ingredient` | Item ID, item tag, or loader ingredient object. | |
| `input_items.count` (Optional) | Items required from one stack; default 1. The item stack limit bounds a usable count. | `[1, i32::MAX]` |
| `input_items.components` (Optional) | Exact item-component values. | |
| `input_items.predicates` (Optional) | Item-component predicates. | |
| `input_fluids` (Optional) | Ordered fluid inputs with amount and pressure; defaults to an empty list. | |
| `input_fluids.type` | Registered fluid ID. | |
| `input_fluids.amount` | Amount in mB; use $[1, \mathrm{tank\ capacity}]$ for transfers because machine code casts to int. | `i64` |
| `input_fluids.pressure` (Optional) | Pressure level; default 0. | `i32` |
| `output_items` (Optional) | Fixed or weighted item-output positions; defaults to an empty list. | |
| `output_items.item ID` | Fixed output: String form for one item. | |
| `output_items.id` | Item ID in a stack object. | |
| `output_items.count` (Optional) | Stack size; default 1. | `[1, 99]` |
| `output_items.components` (Optional) | Item-component values. | |
| `output_items.chance` (Optional) | Output chance; omit for a guaranteed output. Some machines roll each item of the stack separately. | Rounds to weight `[1, 999]` of 1000 |
| `output_items.data` | Weighted choice: Stack object or an empty object for no output. | |
| `output_items.weight` | Relative selection weight; a positive total selects an output. | `[0, i32::MAX]` each; $\sum_i w_i \le \texttt{i32::MAX}$ |
| `output_fluids` (Optional) | Ordered fluid outputs with amount and pressure; defaults to an empty list. | |
| `output_fluids.type` | Registered fluid ID. | |
| `output_fluids.amount` | Amount in mB; use $[1, \mathrm{tank\ capacity}]$ for transfers because machine code casts to int. | `i64` |
| `output_fluids.pressure` (Optional) | Pressure level; default 0. | `i32` |
| `duration` (Optional) | Process duration in ticks; defaults to 0. | `i32` |
| `power` (Optional) | HE demand; defaults to 0. | `i64` |
| `icon` (Optional) | Stack template displayed for the recipe; otherwise derived from the output. | |
| `icon.id` | Item ID. | |
| `icon.count` (Optional) | Stack size; default 1. | `[1, 99]` |
| `icon.components` (Optional) | Item-component values. | |
| `icon_from_input` (Optional) | Derives the display icon from the first item input when true; defaults to false. | |
| `name_wrapper` (Optional) | Translation key applied around the displayed recipe name. | |
| `custom_localization` (Optional) | Resolves the internal name as a translation key when true; defaults to false. | |
| `blueprint_pools` (Optional) | Blueprint pools containing the recipe; a pooled recipe needs a blueprint of one of them in the machine. | |
| `blueprint_pools_528` (Optional) | Replaces blueprint_pools while the enable_528 flag holds. | |
| `auto_switch_group` (Optional) | Translation key grouping recipes; the machine switches to the group member whose first item input matches its first input slot. | |
| `order` (Optional) | Sort position within the recipe table; lower values first, default 2147483647. | `i32` |

Individual machines set operational input and output requirements and may consume only part of the shared record. Loader condition wrappers are separate from these fields.

NTM machine recipe types[since NTM 1.0.1: , `hbm:crafting_shaped`, `hbm:crafting_shapeless`] and `hbm:material_distribution` reject unknown fields. Both loaders accept `fabric:load_conditions` and `neoforge:conditions` in these files.

> **since NTM 1.0.2**
>
> These formats also accept `_kubejs_changed_marker`, which KubeJS adds to recipes it creates or edits.
