Experience

Make the recipe consume or produce xp

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.

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.

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

Properties

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

Mandatory properties

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

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 :

"mode": "input"

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

Amount

Name : amount

Description :

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

It can be any positive number but remember that the machine experience component must be able to store at least this amount of xp.

Example :

"amount": 1000

The recipe will consume/produce 1000xp.

Optional properties

Form

Name : form

Description :

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 :

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

"form": "level"
Chance

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 :

"chance": 0.7

The requirement will have 70% chance to be processed.

Example

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

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

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

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