> ## Documentation Index
> Fetch the complete documentation index at: https://docs.borntocraftstudio.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands & Interactions

> Adding functionality to GUI items

# Interactions

Items in layouts support:

* **`commands`**: Array of strings executed on any click
* **`interactions`**: Map of click type → commands (LEFT\_CLICK, RIGHT\_CLICK, SHIFT\_LEFT\_CLICK, etc.)
* **`triggers`**: Array of TypeWriter Entry references

```json theme={null}
{
  "slots": [4],
  "item": {},
  "displayName": "<gold>Info",
  "commands": ["dungeon global_info ThePlayer"],
  "interactions": {
    "LEFT_CLICK": ["msg You clicked!"],
    "RIGHT_CLICK": ["msg Right click!"]
  }
}
```

## Scroll Buttons

`ScrollableLayout` with `showDefaultButtons: true` auto-generates arrow buttons:

* **Vertical** (vh > visible): UP arrow at top-right (x=8, y=0), DOWN arrow at middle-right (x=8, y=1)
* **Horizontal** (vw > 9): LEFT arrow at top-left (x=0, y=0), RIGHT arrow at middle-left (x=6, y=0)

Custom buttons can override them via the `buttons` array with `direction` and `item`.
