> For the complete documentation index, see [llms.txt](https://docs.xandtech.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xandtech.fr/home/xtimerewards/reference/placeholderapi.md).

# PlaceholderAPI

Requires [PlaceholderAPI](https://www.spigotmc.org/resources/placeholderapi.6245/) — the expansion registers itself automatically if it's installed, no separate download needed. Unless noted otherwise, a placeholder needs an online player to resolve.

## General

| Placeholder              | Returns                                             |
| ------------------------ | --------------------------------------------------- |
| `%xtimerewards_version%` | The running XTimeRewards version. No player needed. |

## Playtime & milestones

| Placeholder                                  | Returns                                                                                    |
| -------------------------------------------- | ------------------------------------------------------------------------------------------ |
| `%xtimerewards_playtime_<period>%`           | Raw seconds for that period. `<period>`: `daily`/`weekly`/`monthly`/`yearly`/`total`.      |
| `%xtimerewards_playtime_<period>_formatted%` | Same, formatted (e.g. `3h 12m`).                                                           |
| `%xtimerewards_rank_<period>%`               | The requesting player's own rank on that period's leaderboard.                             |
| `%xtimerewards_next_milestone_name%`         | Display name of the player's next unclaimed milestone across every period, or `-` if none. |
| `%xtimerewards_next_milestone_remaining%`    | Seconds remaining until that milestone, or `0`.                                            |

## Leaderboard (any rank, no viewing player needed)

| Placeholder                                                                   | Returns                                                                         |
| ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `%xtimerewards_top_playtime_<period>_<position>_name%`                        | Name of the player at that rank. `<position>` is 1-based.                       |
| `%xtimerewards_top_playtime_<period>_<position>_value%`                       | Their raw seconds.                                                              |
| `%xtimerewards_top_playtime_<period>_<position>_value_formatted%`             | Their formatted time.                                                           |
| `%xtimerewards_top_streak_<position>_name%` / `_value%` / `_value_formatted%` | Same, for the streak leaderboard (no `<period>` — streaks aren't period-keyed). |

{% hint style="info" %}
These `top_*` placeholders work **without a viewing player** — usable on a sign, hologram, or scoreboard, unlike `%xtimerewards_rank_<period>%` which is always the requesting player's own rank. A position past the leaderboard's actual size resolves to `-` (name) or `0` (value) rather than showing literal `%...%` text. Backed by a short-lived (5s) in-memory cache so a multi-line hologram refreshing every second doesn't hit storage once per rank per tick.
{% endhint %}

## Period reset countdown (no viewing player needed)

| Placeholder                                         | Returns                                                                                                                       |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `%xtimerewards_reset_<period>_remaining%`           | Seconds until that period's next rollover (`daily`/`weekly`/`monthly`/`yearly` — `total` has no rollover and isn't accepted). |
| `%xtimerewards_reset_<period>_remaining_formatted%` | Same, formatted.                                                                                                              |

Respects any custom [`period-reset`](/home/xtimerewards/getting-started/getting-started.md) times you've configured.

## AFK detection

| Placeholder                                                           | Returns                                                                     |
| --------------------------------------------------------------------- | --------------------------------------------------------------------------- |
| `%xtimerewards_is_afk%`                                               | `true`/`false`.                                                             |
| `%xtimerewards_afk%` / `%xtimerewards_afk_formatted%`                 | Lifetime AFK time (only accumulates if `afk.track-afk-playtime` is on).     |
| `%xtimerewards_afk_session%` / `%xtimerewards_afk_session_formatted%` | How long the player has been continuously AFK right now (`0` while active). |

## AFK mode

| Placeholder                                                                     | Returns                         |
| ------------------------------------------------------------------------------- | ------------------------------- |
| `%xtimerewards_is_afk_mode%`                                                    | `true`/`false`.                 |
| `%xtimerewards_afk_mode%` / `%xtimerewards_afk_mode_formatted%`                 | Lifetime AFK-mode time.         |
| `%xtimerewards_afk_mode_session%` / `%xtimerewards_afk_mode_session_formatted%` | Current session's elapsed time. |

## Streaks

| Placeholder                     | Returns                            |
| ------------------------------- | ---------------------------------- |
| `%xtimerewards_streak%`         | Current streak (days).             |
| `%xtimerewards_streak_longest%` | Longest-ever streak.               |
| `%xtimerewards_streak_freezes%` | Banked streak-freeze charge count. |

**Example:** `%xtimerewards_top_playtime_weekly_1_name%` → the name of this week's #1 player; `%xtimerewards_top_playtime_weekly_1_value_formatted%` → their playtime, formatted.


---

# 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://docs.xandtech.fr/home/xtimerewards/reference/placeholderapi.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.
