# Container upgrade

The matching carrier supplies the retained item contents.

> **since NTM 1.0.1**
>
> Container upgrades use [shaped crafting](https://movblock.mov/ntm-next/wiki/recipes/crafting-shaped.md) with `input_state.<symbol>.preserve: result`. The selected pattern occurrence supplies the retained component changes; `result.count` is 1.

> **removed in NTM 1.0.1** → Replaced by: [recipes/crafting-shaped](https://movblock.mov/ntm-next/wiki/recipes/crafting-shaped.md)
>
> Use a shaped crafting recipe to upgrade a crate or mass storage unit. The pattern matches as vanilla shaped crafting. The result applies the carrier's component changes, including its contents and lock.
>
> ## Fields
>
> | Field | Meaning and default | Range |
> | - | - | - |
> | `type` | Selects the `hbm:container_upgrade` recipe format. | |
> | `carrier` | Ingredient selecting the grid stack whose component changes the result receives; the first matching stack applies. | |
> | `key` | Maps each grid symbol to a vanilla crafting ingredient. | |
> | `pattern` | 1–3 equal-width rows, each at most 3 characters. | |
> | `result` | Output stack template carrying the matched carrier's component changes. | |
> | `result.id` | Item ID. | |
> | `result.count` (Optional) | Stack size; default 1. | `[1, 99]` |
> | `result.components` (Optional) | Item-component values. | |
> | `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`. | |

## Example

Source path: `data/hbm/recipe/crate_desh.json`

*NTM 1.0.0:*

```json
{
  "type": "hbm:container_upgrade",
  "carrier": "hbm:crate_steel",
  "key": {
    "D": "hbm:plate_desh",
    "S": "hbm:crate_steel"
  },
  "pattern": [
    " D ",
    "DSD",
    " D "
  ],
  "result": {
    "id": "hbm:crate_desh"
  }
}
```

*NTM 1.0.1–1.0.4:*

```json
{
  "type": "hbm:crafting_shaped",
  "input_state": {
    "S": {
      "preserve": "result"
    }
  },
  "key": {
    "D": "hbm:plate_desh",
    "S": "hbm:crate_steel"
  },
  "pattern": [
    " D ",
    "DSD",
    " D "
  ],
  "result": {
    "id": "hbm:crate_desh"
  }
}
```
