# Shapeless crafting

Ingredient-index input state in shapeless crafting recipes.

**since NTM 1.0.1**

File: `data/<namespace>/recipe/<path>.json`.

`hbm:crafting_shapeless` uses the same JSON on Fabric and NeoForge; NTM's bundled shapeless crafting recipes use it. It assigns each occupied slot to one ingredient, including when ingredient alternatives overlap. [Input-state rules](https://movblock.mov/ntm-next/wiki/recipes/input-state.md) identify zero-based entries in `ingredients`, independent of grid position. Inputs accept pristine stacks by default.

## Fields

| Field | Meaning and default | Range |
| - | - | - |
| `type` | Selects the `hbm:crafting_shapeless` recipe format. | |
| `ingredients` | 1–9 ingredients; each entry consumes one item from its assigned slot. | |
| `result` | Output stack template. A result carrier requires count 1. | |
| `result.id` | Item ID. | |
| `result.count` (Optional) | Stack size; default 1. | `[1, 99]` |
| `result.components` (Optional) | Item-component values. | |
| `input_state` (Optional) | Input-state rules keyed by zero-based ingredient index; default empty. | |
| `input_state.<selector>` | Pattern symbol or zero-based ingredient index mapped to an input rule. | |
| `input_state.<selector>.components` (Optional) | Exact component values required on this input; default empty. | |
| `input_state.<selector>.predicates` (Optional) | Registered component predicates required on this input; default empty. | |
| `input_state.<selector>.preserve` (Optional) | State destination: result or remainder. Omit to consume only pristine or explicitly required state. | |
| `category` (Optional) | Recipe-book category: `building`, `redstone`, `equipment`, or `misc`; default `misc`. | |
| `group` (Optional) | Recipe-book group string; default empty. | |
| `show_notification` (Optional) | Shows the recipe-unlock notification; default `true`. | |

Selectors are strings from `"0"` through the last ingredient index. At most one entry may use `preserve: result`. [Loader conditions](https://movblock.mov/ntm-next/wiki/recipes/conditions.md) can wrap the recipe.

## Example:

A shapeless variant of the four-plate crate upgrade. The stack assigned to ingredient `0` supplies the retained contents.

```json
{
  "type": "hbm:crafting_shapeless",
  "ingredients": [
    "hbm:crate_steel",
    "hbm:plate_desh", "hbm:plate_desh", "hbm:plate_desh", "hbm:plate_desh"
  ],
  "input_state": {"0": {"preserve": "result"}},
  "result": {"id": "hbm:crate_desh", "count": 1}
}
```
