> For the complete documentation index, see [llms.txt](https://ney.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ney.gitbook.io/docs/mythichud-extension/variables.md).

# Variables

MythicHUD Extension publishes dialogue state through PlaceholderAPI.

### Placeholder Format

All placeholders use this format:

```yaml
%typewriter_mythichud_<variable>%
```

For example:

```yaml
%typewriter_mythichud_speaker%
%typewriter_mythichud_text_line_1%
%typewriter_mythichud_selected_option%
```

When no MythicHUD dialogue is active, placeholders return an empty string.

### Common Dialogue Variables

<table><thead><tr><th>Variable</th><th>Spoken</th><th>Option</th><th>Cinematic</th><th width="162">Description</th></tr></thead><tbody><tr><td><code>show</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Returns <code>true</code> while dialogue state is active</td></tr><tr><td><code>speaker</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Display name of the configured speaker</td></tr><tr><td><code>text</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>All currently visible typewriter text in one value</td></tr><tr><td><code>text_line_{number}</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>One automatically wrapped visible text line</td></tr><tr><td><code>text_line_count</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Number of currently generated text lines</td></tr><tr><td><code>progress</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Integer typewriter progress from <code>0</code> to <code>100</code></td></tr><tr><td><code>percentage</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Decimal typewriter progress from <code>0.00</code> to <code>1.00</code></td></tr><tr><td><code>is_complete</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Whether typing has completed</td></tr><tr><td><code>raw_text</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Complete plain text without MiniMessage tags</td></tr><tr><td><code>total_chars</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Number of characters in <code>raw_text</code></td></tr><tr><td><code>visible_chars</code></td><td>Yes</td><td>Yes</td><td>Yes</td><td>Number of currently visible characters</td></tr><tr><td><code>instruction</code></td><td>Yes</td><td>Yes</td><td>No</td><td>Returns <code>continue</code> or <code>finish</code></td></tr><tr><td><code>confirmation_key</code></td><td>Yes</td><td>Yes</td><td>No</td><td>Configured Typewriter confirmation key</td></tr></tbody></table>

#### Dynamic Text Lines

Dialogue text is automatically wrapped using Minecraft default-font pixel widths. The extension publishes as many indexed lines as necessary:

```
%typewriter_mythichud_text_line_1%
%typewriter_mythichud_text_line_2%
%typewriter_mythichud_text_line_3%
...
```

The current number of generated lines is available as:

```
%typewriter_mythichud_text_line_count%
```

### Option Variables

Option entries include all common variables plus the values below.

#### Selection

| Variable          | Description                                     | Example            |
| ----------------- | ----------------------------------------------- | ------------------ |
| `options_count`   | Number of currently available options           | `3`                |
| `selected_index`  | Zero-based selected index, or `-1` while typing | `0`                |
| `selected_option` | Text of the selected option                     | `Accept the quest` |
| `has_options`     | Whether any options are available               | `true`             |

#### Previous and Next

| Variable          | Description                            |
| ----------------- | -------------------------------------- |
| `previous_option` | Text before the selected option        |
| `next_option`     | Text after the selected option         |
| `previous_index`  | Zero-based previous index, or `-1`     |
| `next_index`      | Zero-based next index, or `-1`         |
| `has_previous`    | Whether a previous option is available |
| `has_next`        | Whether a next option is available     |

When infinite scrolling is enabled, previous and next values wrap around the option list.

#### Animated Visible Options

The extension exposes up to four options around the current selection, including a `visible` value for the post-typing reveal animation:

| Variable pattern          | Description                                |
| ------------------------- | ------------------------------------------ |
| `option_{index}_text`     | Option text at the visible position        |
| `option_{index}_selected` | Whether the option is selected             |
| `option_{index}_visible`  | Whether its reveal animation has completed |
| `option_{index}_prefix`   | Selection or navigation prefix             |

#### Current Page

These placeholders expose the current page of three options:

| Variable pattern               | Description                           |
| ------------------------------ | ------------------------------------- |
| `all_option_{position}_text`   | Text at page position `0` through `2` |
| `all_option_{position}_prefix` | Selected prefix for that position     |

Examples:

```yaml
%typewriter_mythichud_all_option_0_text%
%typewriter_mythichud_all_option_0_prefix%
%typewriter_mythichud_all_option_1_text%
```

### Custom Variables

Custom variables configured in a Typewriter entry are exposed with a `custom_` prefix:

```yaml
%typewriter_mythichud_custom_<key>%
```

For a custom variable named `quest_name`:

```yaml
%typewriter_mythichud_custom_quest_name%
```
