# Recipes

Toil and Trouble features custom data-driven recipes.

## Brewing

Cauldron Brewing recipes use the following format:

<Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="NBT Compound/JSON Object" />: The root object.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/string" title="String" /> **type**: Which recipe to use, in this case `toil_and_trouble:brewing`.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Object" /> **reagent**: An ingredient that is consumed by the brew.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Cauldron Contents" /> **potion**: A [Cauldron Contents](cauldron-contents) data component that is consumed by the brew.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Cauldron Contents" /> **result**: A [Cauldron Contents](cauldron-contents) data component that will end up as the Cauldron Contents.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Object" /> **particle_type**: Optional: A particle type displayed after a successful brew, see [Particle Format](https://minecraft.wiki/w/Particle_format).\
|	└── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/string" title="String" /> **type**: A [particle type](https://minecraft.wiki/w/Particles_(Java_Edition)).
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/boolean" title="Boolean" /> **type**: Whether to place the id set in `result` as a block.\


An example recipe is below, which crafts an Awkward Potion from the `toil_and_trouble:creates_awkward_potions` item tag (which contains Nether Wart) and the Water Bottle potion.

```json
{
  "type": "toil_and_trouble:brewing",
  "reagent": "#toil_and_trouble:creates_awkward_potions",
  "potion": "minecraft:water",
  "result": "minecraft:awkward"
}
```

As a more complicated example, this potion consumes a Nether Star to create a Haste V potion with a white tint.
```json
{
  "type": "toil_and_trouble:brewing",
  "reagent": "minecraft:nether_star",
  "potion": "minecraft:awkward",
  "result": {
    "custom_color": 16383998,
    "custom_effects": [
      {
        "id":"minecraft:haste",
        "amplifier": 4,
        "duration": 60
      }
    ]
  },
  "particle_type": {
    "type": "minecraft:happy_villager"
  }
}
```

### Non-Potions

Toil and Trouble also supports a variety of vanilla non-potion fluids and "fluids". Currently supported are:
- Air ("minecraft:air")
- Water ("toil_and_trouble:water")
- Lava ("toil_and_trouble:lava")
- Honey ("toil_and_trouble:honey")
- Milk ("toil_and_trouble:milk")

Toil and Trouble also allows arbitrary blocks to be created from a successful brew. For example, to replace the Cauldron with a Lava Cauldron, set the `id` field to `minecraft:lava_cauldron`, and set `place_as_block` to true.

```json
{
  "type": "toil_and_trouble:brewing",
  "reagent": {
    "item": "minecraft:cobblestone"
  },
  "potion": {
    "id": "minecraft:air"
  },
  "result": {
    "id": "toil_and_trouble:lava",
    "amount": 1
  },
  "requires_heat": true,
  "particle_type": {
    "type": "flame"
  },
  "place_as_block": true
}
```

## Alchemy

Cauldron Alchemy recipes use the following format:

<Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="NBT Compound/JSON Object" />: The root object.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/string" title="String" /> **type**: Which recipe to use, in this case `toil_and_trouble:alchemy`.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Object" /> **reagent**: An ingredient that is consumed by the brew.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/boolean" title="Boolean" /> **requires_heat**: Optional, defaults to config: Whether heat is required to complete this recipe.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/boolean" title="Boolean" /> **copy_components**: Optional, defaults to `false`: Whether the first reagent's components should be copied to the result.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Cauldron Contents" /> **potion**: A [Cauldron Contents](cauldron-contents) data component that is consumed by the brew.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Object" /> **result**: An item stack that will end up in an empty Cauldron.\
|	└── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/string" title="String" /> **id**: An [item id](https://minecraft.wiki/w/Java_Edition_data_values#Items).\
|	└── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Object" /> **components**: Optional. Additional information about the item. See [item components](https://minecraft.wiki/w/Data_component_format). \
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/boolean" title="Boolean" /> **place_as_block**: Optional, defaults to false: Whether to place the id set in `result` as a block.\
├── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/object" title="Object" /> **particle_type**: Optional: A particle type displayed after a successful brew, see [Particle Format](https://minecraft.wiki/w/Particle_format).\
|	└── <Asset width={16} height={16} location="toil_and_trouble:nbtsheet/string" title="String" /> **type**: A [particle type](https://minecraft.wiki/w/Particles_(Java_Edition)).


An example recipe is below, which crafts an Cooked Cod with the custom name Awkward Fish from the `minecraft:fishes` item tag and the Awkward potion.


```json
{
  "type": "toil_and_trouble:alchemy",
  "reagent": "#minecraft:fishes",
  "potion": "minecraft:awkward",
  "result": {
    "id": "minecraft:cooked_cod",
    "components": {
      "minecraft:rarity": "epic",
      "minecraft:item_name": "\"Awkward Fish\""
    }
  },
  "place_as_block": false,
  "particle_type": {
    "type": "minecraft:angry_villager"
  }
}
```

This recipe uses the `place_as_block` property to place an arbitrary blockstate.

```json
{
  "type": "toil_and_trouble:alchemy",
  "reagent": "minecraft:bamboo",
  "result": {
    "id": "minecraft:bamboo_slab",
    "components": {
      "minecraft:block_state": {"type":"top"}
    }
  },
  "place_as_block": true,
  "particle_type": {
    "type": "minecraft:angry_villager"
  }
}
```

## Insertion

Insertion recipes cover taking items inside and outside Cauldrons. Examples are below.

### Filling
```json
{
  "type": "toil_and_trouble:inserting",
  "item": {
    "id": "minecraft:honey_bottle"
  },
  "contents": {
    "id": "minecraft:air"
  },
  "result_item": {
    "id": "minecraft:glass_bottle"
  },
  "result_contents": {
    "id": "toil_and_trouble:honey"
  },
  "amount": 1
}
```

### Bottling

```json
{
  "type": "toil_and_trouble:inserting",
  "item": {
    "id": "minecraft:glass_bottle"
  },
  "contents": {
    "id": "toil_and_trouble:honey"
  },
  "result_item": {
    "id": "minecraft:honey_bottle"
  },
  "result_contents": {
    "id": "toil_and_trouble:honey"
  },
  "amount": -1
}
```