> For the complete documentation index, see [llms.txt](https://frinn.gitbook.io/custom-machinery-1.21/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://frinn.gitbook.io/custom-machinery-1.21/recipes/requirements/experience.md).

# Experience

Experience requirement is used to define xp inputs and outputs for a custom machine recipe.

To use it you just need to provide the amount of xp you want the recipe to consume/produce.

This requirement is available in both `input` and `output` modes.

In input mode : When starting to craft the recipe, the machine will consume the specified amount of xp from the machine [experience component](/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component.md).

In output mode : When starting to craft the recipe, the machine will produce the specified amount of xp and put it in the machine [experience component](/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component.md).

The requirement type of experience requirement is : "`custommachinery:experience"`.

### Properties

The experience requirement has 3 mandatory properties and 2 optional properties.

#### Mandatory properties

```json
"type": "custommachinery:experience" //Mandatory to define an experience requirement.
```

<details>

<summary>Mode</summary>

#### Name : `mode`

#### Description :

Define the I/O mode of the requirement.

* `input` The requirement will consume xp at the start of the crafting process.
* `output` The requirement will produce xp at the end of the crafting process.

#### Example :

```json
"mode": "input"
```

The requirement will consume xp at the start of the crafting process.

</details>

<details>

<summary>Amount</summary>

#### Name : `amount`

#### Description :&#x20;

A positive integer value that define the amount of xp the recipe will consume/produce.&#x20;

It can be any positive number but remember that the machine [experience component](/custom-machinery-1.21/creating-custom-machines/machine-components/experience-component.md) must be able to store at least this amount of xp.

#### Example :&#x20;

```json
"amount": 1000
```

The recipe will consume/produce 1000xp.

</details>

#### Optional properties

<details>

<summary>Form</summary>

#### Name : `form`

#### Description :&#x20;

The type of xp the recipe will consume/produce, must be either `level` or `point`.

If set to `level` remember that in Minecraft xp levels are exponentials, if the machine produce 1 level for each recipe completed that mean it can output the equivalent amount of xp to go from level 0 to 1 or to go from level 999 to 1000 (which is a lot more) depending on if the machine currently has 0 or 999 levels worth of xp stored.

#### Default : `point`

#### Example :&#x20;

The machine will consume/produce 1 level worth of xp.

```json
"form": "level"
```

</details>

<details>

<summary>Chance</summary>

#### Name : `chance`

#### Description :

A double between 0.0 and 1.0 that define the chance of the requirement to be processed.

#### Default : 1

The requirement will always be processed.

#### Example :

```json
"chance": 0.7
```

The requirement will have 70% chance to be processed.

</details>

### Example

An experience requirement that will make the recipe produce 2672xp points:

```json
{
    "type": "custommachinery:experience",
    "mode": "output",
    "amount": 2672
}
```

An experience requirement that will make the recipe consume 10xp levels with 80% chance:

```json
{
    "type": "custommachinery:experience",
    "mode": "input",
    "amount": 10,
    "form": "level",
    "chance": 0.8
}
```
