# Tubing XML

The Tubing XML is a definition how to build [Tubing GUIs](/tubing/tubing-guis.md)\
Below I will explain the different parts of the XML

### \<TubingGui>

The TubingGui is the root element of the XML file. it defines the size of the GUI and contains multiple GuiItems.

```xml
<TubingGui size="54" id="some-gui">
        <title>Some GUI</title>

        <GuiItem slot="12"
                material="PAPER"
                onLeftClick="select-reason&reason=SOME_REASON">
           <name>Some reason</name>
        </GuiItem>
</TubingGui>
```

#### attributes

| attribute | description                                               | required |
| --------- | --------------------------------------------------------- | -------- |
| size      | How big the inventory should be. Must be a multiple of 9. | true     |
| id        | id of the GUI. Only used for styling                      | false    |
| class     | Class of the GUI. Only used for styling                   | false    |

#### children

<table><thead><tr><th>child</th><th width="225.338783852836">Description</th><th>required</th></tr></thead><tbody><tr><td>title</td><td>The title of the GUI</td><td>true</td></tr><tr><td>GuiItem</td><td>The different items you want to show in the GUI</td><td>false, but it makes sense to have at least some items in the GUI</td></tr></tbody></table>

### \<title>

The title of the GUI.

#### attributes

| attribute | description                             | required |
| --------- | --------------------------------------- | -------- |
| color     | The color of the text                   | false    |
| id        | id of the GUI. Only used for styling    | false    |
| class     | Class of the GUI. Only used for styling | false    |

### \<GuiItem>

This is the biggest part of the GUI. Every GuiItem represent an item inside the inventory.

```xml
<GuiItem slot="13" id="appeal-info" material="BOOK">
    <name class="item-name">
        <t id="appeal-status-label">Appeal </t>
        <t id="appeal-status-value" color="&6">OPEN</t>
    </name>
    <Lore>
        <LoreLine>
            <t color="&b" id="appealer-label" class="detail-label">Appealer: </t>
            <t color="&6" id="appealer-value" class="detail-value">appealer</t>
        </LoreLine>
    </Lore>
</GuiItem>
```

#### attributes

| attribute     | description                                                       | required |
| ------------- | ----------------------------------------------------------------- | -------- |
| slot          | The index of the inventory slot                                   | true     |
| material      | Material of the item                                              | true     |
| if            | Only show the item when the value of the if attribute is true     | false    |
| permission    | Only show the item if the current player has the given permission | false    |
| onLeftClick   | action to execute when the player left clicks on this item        | false    |
| onMiddleClick | action to execute when the player middle clicks on this item      | false    |
| onRightClick  | action to execute when the player right clicks on this item       | false    |
| id            | id of the GUI. Only used for styling                              | false    |
| class         | Class of the GUI. Only used for styling                           | false    |

#### children

| child | description                                          | required |
| ----- | ---------------------------------------------------- | -------- |
| name  | The name of the element shown in the GUI             | false    |
| Lore  | The lore of the item. Consists of multiple LoreLines | false    |

### \<name>

Direct child of [GuiItem](#less-than-guiitem-greater-than). It describes the name of the GuiItem.

The name is an element that has 2 possible content type. Either just a String, or multiple [\<t>](#less-than-t-greater-than) tags.

#### attributes

| attribute | description                             | required |
| --------- | --------------------------------------- | -------- |
| color     | The color of the text                   | false    |
| id        | id of the GUI. Only used for styling    | false    |
| class     | Class of the GUI. Only used for styling | false    |

### \<Lore>

Direct child of [GuiItem](#less-than-guiitem-greater-than). It describes the Lore of the GuiItem.

#### attributes

<table><thead><tr><th width="247.33333333333331">attribute</th><th width="201.10195674562308">description</th><th>required</th></tr></thead><tbody><tr><td>if</td><td>Only show the lore when the value of the if attribute is true</td><td>false</td></tr><tr><td>permission</td><td>Only show the lore if the current player has the given permission</td><td>false</td></tr><tr><td>id</td><td>id of the GUI. Only used for styling</td><td>false</td></tr><tr><td>class</td><td>Class of the GUI. Only used for styling</td><td>false</td></tr></tbody></table>

#### children

| child            | description                                                         | required |
| ---------------- | ------------------------------------------------------------------- | -------- |
| List of LoreLine | Every LoreLine is one line of lore of the item inside the inventory | true     |

### \<LoreLine

Direct child of [Lore](#less-than-lore-greater-than). Describes one line of lore of one item.

The name is an element that has 2 possible content type. Either just a String, or multiple [\<t>](#less-than-t-greater-than) tags.

#### attributes

<table><thead><tr><th width="247.33333333333331">attribute</th><th width="201.10195674562308">description</th><th>required</th></tr></thead><tbody><tr><td>if</td><td>Only show the loreline when the value of the if attribute is true</td><td>false</td></tr><tr><td>permission</td><td>Only show the loreline if the current player has the given permission</td><td>false</td></tr><tr><td>id</td><td>id of the GUI. Only used for styling</td><td>false</td></tr><tr><td>class</td><td>Class of the GUI. Only used for styling</td><td>false</td></tr></tbody></table>

### \<t>

t is used to define a text. You can have multiple \<t> tags next to each other.\
This is mostly useful if you want to give the user of the plugin more control over the styling of the different parts of the text.

#### without T tags

```markup
<LoreLine>&bAppealer: &6${appeal.appealerName}</LoreLine>
```

#### With T tags

```markup
<LoreLine>
   <t color="&b" id="appealer-label" class="detail-label">Appealer: </t>
   <t color="&6" id="appealer-value" class="detail-value">${appeal.appealerName}</t>
</LoreLine>
```

Although the first one is much shorter, there is no way to allow Tubing to style this GUI.\
Using T tags we now have control over the color and label and value of the text. These can be styled separately by using Tubing styling files.

#### attributes

<table><thead><tr><th width="247.33333333333331">attribute</th><th width="201.10195674562308">description</th><th>required</th></tr></thead><tbody><tr><td>color</td><td>The color of the text part</td><td>false</td></tr><tr><td>if</td><td>Only show the loreline when the value of the if attribute is true</td><td>false</td></tr><tr><td>permission</td><td>Only show the loreline if the current player has the given permission</td><td>false</td></tr><tr><td>id</td><td>id of the GUI. Only used for styling</td><td>false</td></tr><tr><td>class</td><td>Class of the GUI. Only used for styling</td><td>false</td></tr></tbody></table>

###


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://staffplusplus-minecraft.gitbook.io/tubing/tubing-guis/templates/tubing-xml.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
