> 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/betterhud-extension/snippets.md).

# Snippets

Snippets are server-wide default values used by BetterHud Extension. They are stored in:

```
plugins/Typewriter/snippets.yml
```

Learn more: [Typewriter Snippets](https://docs.typewritermc.com/docs/helpful-features/snippets)

### How Snippets Work

> **Important:** A snippet is normally created when an entry using it runs for the first time. Trigger the relevant entry before expecting the value to appear in `snippets.yml`.

The `popup` snippets are only used when an entry's `popupId` field resolves to an empty string. The entry defaults already use `typewriter_dialogue` and `typewriter_dialogue_option`.

### Available Snippets

#### Dialogue Text

BetterHud handles maximum line width and line count inside the text element with `split-width` and `line`. BetterHud Extension does not need a separate dialogue wrapping snippet.

#### Spoken

| Snippet                  | Default | Description                                   |
| ------------------------ | ------- | --------------------------------------------- |
| `betterhud.spoken.popup` | `""`    | Fallback popup when Spoken `popupId` is empty |

#### Option

| Snippet                            | Default               | Description                                                          |
| ---------------------------------- | --------------------- | -------------------------------------------------------------------- |
| `betterhud.option.popup`           | `""`                  | Fallback popup when Option `popupId` is empty                        |
| `betterhud.option.sound`           | `"block.lever.click"` | Sound played when changing selection                                 |
| `betterhud.option.volume`          | `1.0`                 | Selection sound volume                                               |
| `betterhud.option.pitch`           | `2.0`                 | Selection sound pitch                                                |
| `betterhud.option.selected_prefix` | `">>>"`               | Prefix used by `all_option_{position}_prefix`                        |
| `betterhud.option.placeholder`     | `"---"`               | Text used before option reveal and for empty three-option page slots |

#### Cinematic

| Snippet                                   | Default | Description                                  |
| ----------------------------------------- | ------- | -------------------------------------------- |
| `cinematic.betterhud_dialogue.percentage` | `0.5`   | Fraction of each segment reserved for typing |

A value of `0.5` uses the first half of the segment for typing and leaves the second half fully visible.

### Choosing Between `popupId` and Snippets

Use `popupId` when a specific entry or cinematic segment requires a unique design.

Use snippets when many entries intentionally leave `popupId` empty and should share one server-wide fallback.
