> For the complete documentation index, see [llms.txt](https://visionstore.gitbook.io/visionstore-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://visionstore.gitbook.io/visionstore-docs/scripts/crafting/configuration/recipes.md).

# Recipes and categories

Add, edit or remove recipes and categories, and use every recipe option including blueprints.

Recipes live in `config/recipes/`. **One file = one category = one tab on the bench.** Every `.lua` file in that folder is loaded automatically. `config/recipes/_README.lua` is the built-in manual.

## Add a recipe

Open the category file (for example `config/recipes/tools.lua`) and add a block:

```lua
Config.Recipes['lockpick'] = {
    category    = 'tools',
    level       = 0,          -- bench level required
    time        = 15,         -- seconds per item
    xp          = 15,         -- bench XP per item
    ingredients = {
        { item = 'metalscrap', amount = 3 },
        { item = 'plastic',    amount = 1 },
    },
    result      = { item = 'lockpick', amount = 1 },
}
```

The **label, description and image come from ox\_inventory automatically**. Restart the resource and the recipe is on the bench.

{% hint style="success" %}
**Check your work:** run `crafting validate` in the server console (or `/crafting validate` in game). It lists typos, unknown categories and every item that doesn't exist in ox\_inventory. A recipe whose items are missing is switched off (not broken) until you add them.
{% endhint %}

## Remove a recipe

Delete its block, or comment it out with `--[[ ... ]]`. Crafts already queued for a removed recipe are **refunded automatically**.

## Add a category (a new tab)

{% stepper %}
{% step %}

### Create the file

Create `config/recipes/food.lua`:

```lua
Config.Categories = Config.Categories or {}
Config.Recipes    = Config.Recipes or {}

Config.Categories['food'] = { label = 'Food', order = 50 }

Config.Recipes['sandwich'] = {
    category = 'food', level = 0, time = 20, xp = 10,
    ingredients = { { item = 'bread', amount = 1 } },
    result = { item = 'sandwich', amount = 1 },
}
```

`order` sorts the tabs (the starter categories use `10`, `20`, `30` and `35`).
{% endstep %}

{% step %}

### Show it on a bench

Add the category to a bench type in `config/benches.lua`:

```lua
categories = { 'tools', 'food' },
```

Or create a new bench type for it (see [Bench types](/visionstore-docs/scripts/crafting/configuration/benches.md)).
{% endstep %}

{% step %}

### Restart

`restart Chapo_Crafting`, then `crafting validate`.
{% endstep %}
{% endstepper %}

## Every recipe option

```lua
Config.Recipes['example'] = {
    category      = 'tools',          -- REQUIRED: key of a category
    label         = 'Custom Name',    -- default: the result item's label
    description   = 'Shown under the name.', -- default: the item's description
    image         = 'nui://...png',   -- default: the result item's image
    order         = 10,               -- sort position inside the category

    level         = 3,                -- bench level required        (default 0)
    categoryLevel = 0,                -- only if Config.Crafting.disableCategoryLevels = false
    time          = 60,               -- seconds per item            (default 10)
    fixedTime     = false,            -- true = one duration for the whole batch
    xp            = 40,               -- bench XP per item           (default 25)

    ingredients = {
        { item = 'steel', amount = 4 },
    },

    -- One result ...
    result  = { item = 'lockpick', amount = 1 },
    -- ... or several (use `results` instead of `result`):
    results = {
        { item = 'lockpick', amount = 1 },
        { item = 'metalscrap', amount = 1, metadata = { quality = 100 } },
    },

    blueprints = { 'pistol' },        -- keys from config/blueprints.lua

    cooldown = {                      -- per player
        limit  = 3,                   -- crafts allowed ...
        window = 3600,                -- ... per this many seconds
    },

    failure = {
        chance      = 10,             -- percent 0-100
        mode        = 'partial_refund', -- 'consume' | 'refund' | 'partial_refund' | 'custom'
        refundRatio = 0.5,            -- for partial_refund
    },

    prop = {                          -- prop held during the craft animation
        model    = 'prop_tool_screwdvr01',
        offset   = vec3(0.0, 0.0, 0.0),
        rotation = vec3(0.0, 0.0, 0.0),
    },
}
```

| Field                             | Default            | What it does                                                                                             |
| --------------------------------- | ------------------ | -------------------------------------------------------------------------------------------------------- |
| `category`                        | required           | The tab this recipe appears in.                                                                          |
| `label` / `description` / `image` | from ox\_inventory | Override what the bench shows.                                                                           |
| `order`                           | `1000`             | Position inside the category (lower first).                                                              |
| `level`                           | `0`                | Bench level needed. See [Bench levels](/visionstore-docs/scripts/crafting/configuration/progression.md). |
| `categoryLevel`                   | `0`                | Category level needed. Only used when `Config.Crafting.disableCategoryLevels = false`.                   |
| `time`                            | `10`               | Seconds **per item**. A batch of 5 takes 5× as long...                                                   |
| `fixedTime`                       | `false`            | ...unless this is `true`: then the whole batch takes `time` once.                                        |
| `xp`                              | `25`               | Bench XP **per item** (`Config.Progression.defaultRecipeXP`). Also drives Crafting Mastery XP.           |
| `ingredients`                     |                    | Items taken when the craft starts.                                                                       |
| `result` / `results`              |                    | What the player gets. `results` gives several items, each with optional `metadata`.                      |
| `blueprints`                      | none               | Blueprints the player must own. See [Blueprints](#blueprints).                                           |
| `cooldown`                        | none               | Max `limit` crafts per `window` seconds, per player.                                                     |
| `failure`                         | none               | A chance for units to fail. See below.                                                                   |
| `prop`                            | none               | A prop the player holds during the crafting animation.                                                   |

### Failure modes

| `mode`             | What a failed unit gives back                                                                                                                               |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `'consume'`        | Nothing. The ingredients are lost.                                                                                                                          |
| `'refund'`         | All the ingredients of that unit.                                                                                                                           |
| `'partial_refund'` | `refundRatio` of the ingredients (for example `0.5` = half).                                                                                                |
| `'custom'`         | Whatever your own script decides, through the `customFailure` event (see [Events](/visionstore-docs/scripts/crafting/developers/events.md#custom-failure)). |

The starter `thermite` recipe is an example: `failure = { chance = 10, mode = 'partial_refund', refundRatio = 0.5 }`.

{% hint style="info" %}
Benches also wear from use, and very worn benches can refuse demanding recipes. You can set a minimum condition per recipe in `config/condition.lua` (see [Wear and maintenance](/visionstore-docs/scripts/crafting/configuration/condition.md)).
{% endhint %}

## Blueprints

A blueprint is an extra gate on a recipe: the player must own it before they can craft. Define blueprints in `config/blueprints.lua` (the file ships with commented examples):

```lua
Config.Blueprints = {
    pistol = {
        label = 'Pistol Blueprint',
        item  = 'pistol_blueprint',
    },

    smg = {
        label = 'SMG Blueprint',
        item  = 'smg_blueprint',
        uses  = 5,
    },
}
```

| Field         | What it does                                                                                         |
| ------------- | ---------------------------------------------------------------------------------------------------- |
| `label`       | Display name.                                                                                        |
| `description` | Optional.                                                                                            |
| `item`        | Item name. Default: `Config.BlueprintItem.format`, so blueprint `pistol` → item `pistol_blueprint`.  |
| `uses`        | `nil` = unlimited. A number = uses per item (needs `Config.Crafting.removeBlueprintOnCraft = true`). |

Then gate a recipe with `blueprints = { 'pistol' }`. A player owns a blueprint in either of two ways:

* they carry the **blueprint item** (when `Config.Crafting.blueprintItems = true`), or
* they **learned** it, granted from any resource with `exports.Chapo_Crafting:GrantBlueprint(src, 'pistol')` (see [Exports](/visionstore-docs/scripts/crafting/developers/exports.md)).

Remember to add blueprint items to `ox_inventory/data/items.lua` like any other item.

## Starter catalogue

The script ships with 32 recipes on three bench types:

| Category        | File              | Recipes (bench level)                                                                                                                                                                                                        |
| --------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Tools**       | `tools.lua`       | Lockpick (0), Workbench Service Kit (0), Screwdriver Set (1), Radio (1), Repair Kit (2), Advanced Lockpick (3), Industrial Maintenance Kit (3), Advanced Repair Kit (4), Drill (5), Precision Overhaul Kit (5), Thermite (6) |
| **Medical**     | `medical.lua`     | Bandage ×2 (0), Painkillers (1), First Aid Kit (2), IFAK (3)                                                                                                                                                                 |
| **Weapons**     | `weapons.lua`     | Bat (0), Knuckle Dusters (0), Knife (1), Switchblade (2), Armour (2), 9mm ammo ×12 (3), SNS Pistol (4), .45 ammo ×12 (5), Pistol (5), Combat Pistol (6), Micro SMG (8, cooldown: 2 per 6 hours)                              |
| **Attachments** | `attachments.lua` | Flashlight (2), Grip (2), Extended Pistol Clip (4), Light Suppressor (5), Macro Scope (5), Extended SMG Clip (7)                                                                                                             |

Weapon and ammo item names are ox\_inventory's own (`WEAPON_*`, `ammo-9`, `ammo-45`...). Edit any of them freely.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://visionstore.gitbook.io/visionstore-docs/scripts/crafting/configuration/recipes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
