Skip to content

Player Inventory Element

Frinn38 edited this page Jul 30, 2021 · 6 revisions

The Player Inventory Element is used to render the player inventory into the Machine GUI (only the 4 row of items).

Player Inventory Elements are defined in json with : "type": "custommachinery:player_inventory".

There can be only one Player Inventory Element per Machine GUI, if you define several Player Inventory Elements only the first will be used.

While you can change the default texture of the Player Inventory Element you can't change the position of it's slots. See the default texture of the Player Inventory to see how the slots are placed.

Properties

Beside the 3 mandatory properties (type/x/y) and the 3 optional properties (width/height/priority) the Player InventoryElement only have 1 optional property.

Texture (Optional)

Description : The texture of the Player Inventory Element.

Default : "custommachinery:textures/gui/base_inventory.png" The default Player Inventory Texture provided by Custom Machinery.

Example : "texture": "namespace:textures/player_inventory.png" The Element will use the file assets/namespace/textures/player_inventory.png as texture.

Example

A basic Player Inventory Element using the default texture :

{
    "type": "custommachinery:player_inventory",
    "x": 50,
    "y": 80
}

Result :

player_inventory_element

(The diamonds are present in the Player Inventory, you can move them from the Element like in any other GUI)

Clone this wiki locally