# Machine GUI

The Machine GUI is the main tool to interact with the machine in-world. It will be used to display the current status of the machine as well as the different components and their contents.

A machine GUI is not mandatory, if you don't want it just don't put it in the machine json.

A Machine GUI is composed of various GUI Elements, there is no limit of how many elements you can put.

The Machine GUI and it's Elements must be defined as such in the machine json :

```json5
"gui": [
    {
        //Element 1
    },
    {
        //Element 2
    }
]
```

### GUI Elements

There are currently 12 available GUI elements :&#x20;

{% content-ref url="machine-gui/dump-element" %}
[dump-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/dump-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/energy-element" %}
[energy-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/energy-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/fluid-element" %}
[fluid-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/fluid-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/fuel-element" %}
[fuel-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/fuel-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/player-inventory-element" %}
[player-inventory-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/player-inventory-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/progress-bar-element" %}
[progress-bar-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/progress-bar-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/reset-element" %}
[reset-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/reset-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/size-element" %}
[size-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/size-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/slot-element" %}
[slot-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/slot-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/status-element" %}
[status-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/status-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/text-element" %}
[text-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/text-element)
{% endcontent-ref %}

{% content-ref url="machine-gui/texture-element" %}
[texture-element](https://frinn.gitbook.io/custom-machinery-1.16/creating-custom-machines/machine-gui/texture-element)
{% endcontent-ref %}

### Notes

The Machine GUI is by default (and for now it can't be changed) 256px wide and 192px high.

This mean that **the x property cannot be higher than 256** and **the y property cannot be higher than 192**.

Minecraft GUI (including the Custom Machine GUI) are rendered in 2 dimensions Axis X/Y.

X axis is the horizontal axis with 0 at the left of the screen and going to the right.

Y axis is the vertical axis with 0 at the top (no that is not an error) of the screen and going to the bottom.

I repeat because this is a very weird concept but the origin point in Minecraft GUI coordinates is at the top left of the screen, not the bottom left but really the top left !!! And the Y axis is inversed so the positives values are going to the bottom of the screen.

To illustrate this concept here is an image :

![coordinates](https://camo.githubusercontent.com/073bf66a2e5f818f5e004315635cea844900205bafeb4cd8088aa5c3b77c6f2b/68747470733a2f2f692e737461636b2e696d6775722e636f6d2f697059575a2e676966)

(The "stage" white square is your screen)
