Experience component

Make your machine store player xp

The experience machine component can be used to make a machine able to store xp.

This component must be unique, as there is only one "type" of xp in vanilla Minecraft it wound't make sense to have several storages of xp in the same machine.

If you try to add more than 1 experience component only the last will be used.

There are 3 ways to change the amount of xp stored in an experience component :

  • Using a recipe with an experience requirement.

  • From the machine GUI by using an experience gui element.

  • By setting the "retrieve" property (see below) to true a player will receive all the stored xp when taking an item out the specified slots (like in a vanilla furnace).

Experience component is defined with "type": "custommachinery:experience" in the json.

Properties

The experience component has 2 mandatory properties and 2 optional properties :

Mandatory properties

"type": "custommachinery:experience" //Mandatory to define an experience component.
Capacity

Name : capacity

Description :

An integer positive value that define the amount of xp points that can be stored in the machine's buffer.

This value is in literral xp points instead of xp levels, you can go here to convert levels to xp values.

Example :

The machine will be able to store 100 levels worth of xp.

"capacity": 30970

Optional properties

Retrieve

Name : retrieve

Description :

A boolean value (true/false) that define if the player will get all the stored xp when taking an item from a slot in the machine gui, like it does in a vanilla furnace.

Default : false

The player will not recieve the stored xp when taking an item from any slots of the machine.

Example :

The player will get all the stored xp when taking xp from an item slot in the machine gui.

"retrieve": true
slots

Name : slots

Description :

A single or list of slot id(s) that will make the player get all the stored xp when taking an item out of one of these slots. Only if the retrieve property is set to true.

An empty list mean any slot will be valid.

The slot id must be exactly the same as defined in the item component id property.

Default : empty

Any slots can give the stored xp to the player.

Example :

Only the slot named "output" will give the xp to the player.

"slots": "output"

Both "output1" and "output2" slots will give the xp to the player.

"slots": ["output1", "output2"]

Examples

A very basic experience component that can store 100 levels worth of xp.

{
    "type": "custommachinery:experience",
    "capacity": 30970
}

An experience component that can store 100 levels worth of xp and will give all the stored xp when the player take an item from the slot with id "output".

{
    "type": "custommachinery:experience",
    "capacity": 30970,
    "retrieve": true,
    "slots": "output"
}