> For the complete documentation index, see [llms.txt](https://wasd-dev.gitbook.io/wasd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wasd-dev.gitbook.io/wasd/resources/mix-weed/modules/recipe-type.md).

# Recipe Type

All mix recipe is formatted as an array containing objects with the following properties.

### Animation

{% hint style="info" %}
Defines animation settings for interactions. [Animations](https://forge.plebmasters.de/animations) `Not Required`
{% endhint %}

<table><thead><tr><th width="139">Property</th><th width="96">Type</th><th width="142">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>dict</code></td><td>string</td><td><mark style="color:red;"><code>required</code></mark></td><td>Animation dictionary.</td></tr><tr><td><code>clip</code></td><td>string</td><td><mark style="color:red;"><code>required</code></mark></td><td>Animation clip.</td></tr><tr><td><code>flag</code></td><td>number</td><td><code>0</code></td><td>Animation flag.</td></tr><tr><td><code>prop</code></td><td><a href="#prop">Prop</a></td><td><code>nil</code></td><td>Prop settings for the animation.</td></tr><tr><td><code>scenario</code></td><td>string</td><td><code>nil</code></td><td>Must specify either scenario or <code>dict</code>.</td></tr></tbody></table>

### Ingredient

<table><thead><tr><th width="153">Property</th><th width="104">Type</th><th width="150">Default</th><th>Description</th></tr></thead><tbody><tr><td><code>name</code></td><td>string</td><td><mark style="color:red;"><code>required</code></mark></td><td>Item name</td></tr><tr><td><code>label</code></td><td>string</td><td><mark style="color:red;"><code>required</code></mark></td><td>Item label</td></tr><tr><td><code>count</code></td><td>number</td><td><mark style="color:red;"><code>required</code></mark></td><td>Item count</td></tr><tr><td><code>imagePath</code></td><td>string</td><td><code>nil</code></td><td>If not specified, <code>name</code>.png will be used</td></tr></tbody></table>

### UsedEventHandler

{% hint style="info" %}
You can do anything you want to be triggered when the `recipe item` is used.
{% endhint %}

{% hint style="info" %}
Contains the `recipe` param value used in event and export
{% endhint %}

<table><thead><tr><th width="130">Property</th><th width="167">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>event</code></td><td>string</td><td>Event name</td></tr><tr><td><code>func</code></td><td>function</td><td>Function can be specially created</td></tr><tr><td><code>export</code></td><td>string</td><td>Export name</td></tr><tr><td><code>anim</code></td><td><a href="#animation">Animation</a></td><td>Only valid on client side <code>Not required</code></td></tr></tbody></table>

### onRecipeUsed

{% hint style="info" %}
Triggered when the recipe is used
{% endhint %}

<table><thead><tr><th width="176">Property</th><th width="190">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>client</code></td><td><a href="#usedeventhandler">UsedEventHandler</a></td><td>Client-side event handler</td></tr><tr><td><code>server</code></td><td><a href="#usedeventhandler">UsedEventHandler</a></td><td>Server-side event handler</td></tr><tr><td><code>duration</code></td><td>number</td><td>Time after which the item will be available again and <a href="#oneffectover"><code>onEffectOver</code> </a>will be triggered (default: 10000)</td></tr></tbody></table>

### onEffectOver

{% hint style="info" %}
Event handler for when effect is over
{% endhint %}

<table><thead><tr><th width="183">Property</th><th width="246">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>client</code></td><td><a href="#usedeventhandler">UsedEventHandler</a></td><td>Client-side event handler</td></tr><tr><td><code>server</code></td><td><a href="#usedeventhandler">UsedEventHandler</a></td><td>Server-side event handler</td></tr></tbody></table>

### Recipe

{% hint style="info" %}
You can set the contents of all recipes that can be produced by players at the mixing table
{% endhint %}

<table><thead><tr><th width="208">Property</th><th width="218">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>active</code></td><td>boolean</td><td>Whether the weed type is active (default: true).</td></tr><tr><td><code>label</code></td><td>string</td><td>Descriptive label for the recipe.</td></tr><tr><td><code>itemName</code></td><td>string</td><td>Name of the item to be given to inventory when mixed and usable</td></tr><tr><td><code>imagePath</code></td><td>string</td><td>If not specified, .png will be used</td></tr><tr><td><code>level</code></td><td>number</td><td>Minimum level required to produce the item</td></tr><tr><td><code>reputationLevel</code></td><td>number</td><td>Minimum reputation level required to produce the item</td></tr><tr><td><code>ingredients</code></td><td><a href="#ingredient">table&#x3C;key, Ingredient></a></td><td>List of ingredients required for the recipe</td></tr><tr><td><code>removeAfterUsed</code></td><td>boolean</td><td>Set to true to remove the item after it has been used</td></tr><tr><td><code>onUsed</code></td><td><a href="#onrecipeused">onRecipeUsed</a></td><td>Functions/Events triggered after using the item</td></tr><tr><td><code>onEffectOver</code></td><td><a href="#oneffectover">onEffectOver</a></td><td>Functions/Events triggered after the effect is over</td></tr><tr><td><code>description</code></td><td>string</td><td>Description of the recipe</td></tr><tr><td><code>policeAlertChange</code></td><td>number</td><td>Percentage of police dispatch when something is mixed on the table</td></tr></tbody></table>

***

## Examples

{% tabs %}
{% tab title="#1" %}

```lua
[1] = {
    itemName = 'drug_sprint',
    label = 'Drug Sprint Dust',
    imagePath = 'drug.png',
    reputationLevel = 1,
    ingredients = {
        { count = 3, name = 'sativa_leaf', label = 'Sativa Leaf' },
        { count = 3, name = 'indica_leaf', label = 'Indica Leaf' },
    },
    description = 'Increases your speed for a short time',
    removeAfterUsed = true,
    onUsed = {
        duration = 15000,
        client = {
            event = 'wasd-mixweed:recipe:onUseDrugSpring',
        },
    },
},
```

{% endtab %}

{% tab title="#2" %}

```lua
[2] = {
    itemName = 'drug_blurredwater',
    label = 'Blurred Water',
    imagePath = 'water.png',
    reputationLevel = 3,
    ingredients = {
        { count = 1, name = 'drug_poison', label = 'Drug Poison', imagePath = 'drug.png' },
        { count = 1, name = 'water',       label = 'Water' },
    },
    description = 'Water mixed with poison',
    removeAfterUsed = true,
    onUsed = {
        duration = 10000,
        client = {
            event = 'wasd-mixweed:recipe:onUseDrugBlurredWater',
            anim = {
                dict = 'mp_player_intdrink',
                clip = 'loop_bottle',
                prop = {
                    model = 'prop_ld_flow_bottle',
                    pos = vec3(0.03, 0.03, 0.03),
                    rot = vec3(0.0, 0.0, -1.5)
                },
            },
        },
    },
},
```

{% endtab %}
{% endtabs %}
