Item component

Add an item slot inside the machine.

This is the component that let your machine interact with items, basically it add an inventory to your machine.

Each Item Component add 1 slot to the machine inventory and each slot can held 1 stack of item but you can add as many components as you want.

You can add as much item component as you want.

Item Component must be defined by "type": "custommachinery:item".

Properties

The item component has 2 mandatory properties and 7 optional properties.

Mandatory properties

"type": "custommachinery:item" //Mandatory to define an item component.
Id

Name : id

Description :

A string that define the id of the slot (used in gui element and recipes), the string must be all lowercase with letters and numbers only (no spaces or special characters).

Example :

"id": "slot1"

Optional properties

Capacity

Name : capacity

Description :

A positive integer value that define the maximum number of item that you can put in the slot.

This does not override the item stack size (if you set the slot capacity to 100 items will still stack by 64 or less). This is used to decrease the available stack size, not increase it.

Default : 64

Example :

"capacity": 4 //Any item that will be put in the slot will have a maximum stack size of 4 items (or less if the item max stack size is less like tools and armors).
Filter

Name : filter

Description :

A blacklist of items that the slot can't accept.

The items must be referenced by their registry name like minecraft:diamond or minecraft:stone.

You can also use a tag here using the # prefix like #minecraft:logs

Default : empty

All items are accepted by the slot.

Example :

"filter": ["minecraft:diamond", "#minecraft:logs"]

The slot will accept all items but Minecraft diamond and items in the minecraft:logs tag.

Whitelist

Name : whitelist

Description :

A boolean, if true the filter property will act as a whitelist instead of a blacklist, meaning that the slot will only accept items specified in the filter property.

Default : false

The filter property is a blacklist.

Example :

"whitelist": true //The filter property is a whitelist.
Mode

Name : mode

Description :

The IO mode of the slot, used only by recipes to know which slots are inputs and outputs.

Available modes are (input/output/both/none).

While crafting the machine will search for items to consume in input slots and put the recipe results in the output slots.

For changing I/O mode of a slot for external interaction, such as hoppers and pipes see the Config property below.

Default : both

Example :

"mode": "input" //Set the slot as an input slot.
Variant

Name : variant

Description :

Item components can have differents behaviours, a basic item slot, a furnace fuel slot, an upgrade slot... These behaviours are defined in this variant property. Addons can adds their own variants but the current existing variants are :

  • Default : A basic item slot

  • Fuel : A furnace fuel slot, it allows only items with a burn time and will consume them to power the machine.

  • Upgrade : An upgrade slot, it allows only item defined as custom machine upgrade.

  • Fluid : A slot that fill/drains fluid container items to/from the machine internal tanks.

  • Energy : A slot that fill/drains energy container items to/from the machine buffer.

  • Result : A craft recipe's result slot.

Default : custommachinery:default

Example :

"variant": "custommachinery:fuel" //This slot will be a Fuel Slot.
Config
Locked

Name : locked

Description :

A boolean value, if true the player won't be able to place and remove items from this slot.

Recipes and hoppers/pipes will still be able to place/remove items from this component (as long as they match the filter, mode and config properties).

The locking of a slot can be changed using KubeJS or Crafttweaker integration.

Default : false

The player will be able to place items in the slot.

Example :

"locked": true

The player won't be able to place or remove items from the slot.

Example

A basic input slot

{
    "type": "custommachinery:item",
    "id": "input",
    "mode": "input"
}

A Fuel slot that will accept only coal and charcoal (for a furnace for example)

{
    "type": "custommachinery:item",
    "id": "fuel",
    "filter": ["minecraft:coal", "minecraft:charcoal"],
    "whitelist": true,
    "mode": "input",
    "variant": "custommachinery:fuel"
}

Last updated