> For the complete documentation index, see [llms.txt](https://sheets.bed.codes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sheets.bed.codes/features/placeholders.md).

# Placeholders

Sheets features a multi-tier placeholder system to provide dynamic content in your menus.

### 1. Multi-Tier System

Sheets evaluates placeholders in the following order:

1. **Global Variables**: `{{variable_name}}`
   * Defined in `variables/*.yml`.
2. **Arguments/Local Variables**: `{variable_name}`
   * Passed via [commands](/getting-started/commands.md) or [actions](/features/actions.md) like [input](/features/editor.md#2-anvil-input).
3. **Special Placeholders**:
   * `[index]`: Current index in a dynamic slot range.
   * `[slot]`: Current slot number in a dynamic slot range.
4. **Math Expressions**: `{math:expression}` or `{math:int:expression}`
   * Example: `{math:1 + 1}` results in `2.0`.
   * Example: `{math:int:%player_health% * 2}` results in an integer.
5. **Sheets Internal Placeholders**:
   * `%sheets_sheet_[index]_name%`: Name of the Nth sheet.
   * `%sheets_sheet_[index]_exists%`: Whether the Nth sheet exists.
   * `%sheets_template_[index]_name%`: Name of the Nth template.
6. **PlaceholderAPI**: Full support for standard `%player_name%` style placeholders.

### 2. Math Expressions

You can perform calculations directly within your YAML configurations.

```yaml
name: "&aYour Health: {math:int:%player_health%}"
lore:
  - "&7Double health: {math:int:%player_health% * 2}"
```

### 3. Dynamic Slots

Use `[slot]` and `[index]` to create dynamic content based on slot ranges.

```yaml
slots:
  - 0to44

buttons:
  - slot: "[slot]"
    name: "&aItem #[index]"
    lore:
      - "&7This is slot number [slot]"
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://sheets.bed.codes/features/placeholders.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
