Slot element
Add an item slot in the machine gui.
The slot elements is used to render an item slot into the Machine GUI.
Slot elements are defined in json with : "type": "custommachinery:slot"
.
A slot must be associated with an Item Component using the id
property. It will display the item stored in the Item Component and allow you to put or remove the item trough the Machine GUI.
If the slot element cannot find the item component (usually because of an error in the id) the slot will still be rendered but it will be empty and you will not be able to put or remove items.
Properties
The slot element has 4 mandatory properties and 6 optional properties :
Mandatory properties
"type": "custommachinery:slot" //Mandatory to define a slot element.
Optional properties
Example :
A basic slot element linked to an item component using the id "slot1" and using the default texture :
{
"type": "custommachinery:slot",
"x": 20,
"y": 20,
"id": "slot1"
}
Result :

(Here the item component contains 32 diamonds, you can add and remove them through the Slot Element like in any other GUI)
If you add "item": "minecraft:coal"
to the slot element json the slot will be rendered like this

Last updated