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

# Interactive Tags & Formatting

## Interactive Tags & Formatting

CoreChat includes interactive chat keywords that dynamically render rich metadata, item previews, or player statistics directly into public and private chat messages.

***

#### Built-in Interactive Tags

| Tag      | Aliases   | Required Permission | Description                                                                                                          |
| -------- | --------- | ------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `[item]` | `[i]`     | `corechat.item`     | Displays the item currently held in the player's main hand with full name, lore, enchants, and custom data on hover. |
| `[pos]`  | `[coord]` | `corechat.pos`      | Displays the player's current coordinates (`X, Y, Z`) and world name.                                                |
| `[ping]` | `[ms]`    | `corechat.ping`     | Shows the player's real-time latency with dynamic color indicators based on connection quality.                      |

***

#### Tag Behavior & Rules

**1. Item Display (`[item]`)**

* If the player holds an item, the tag is replaced with the custom display name (or vanilla translation key) of the item.
* Hovering over the message in chat opens the native Minecraft item tooltip showing enchants, lore, potion effects, and durability.
* If the player's main hand is empty, CoreChat displays a configurable alert (e.g., `&cYou are not holding any item!`) without consuming chat cooldowns.

**2. Coordinates (`[pos]`)**

* Displays coordinates formatted according to `config.yml` (default: `[World: {world} | X: {x}, Y: {y}, Z: {z}]`).
* Staff can configure click actions on coordinates to facilitate fast moderation or teleportation.

**3. Latency (`[ping]`)**

The ping tag automatically colors itself based on network performance:

* **Green (`< 100ms`):** Excellent connection.
* **Gold/Yellow (`100ms - 300ms`):** Moderate latency.
* **Red (`> 300ms`):** High latency or unstable connection.

***

#### Modern Text Formatting (MiniMessage)

CoreChat supports Adventure MiniMessage across auto-broadcasts, system alerts, and rank formats.

**Gradients & Hex Colors**

```
<gradient:#00D2FF:#3A7BD5>Welcome to the server!</gradient>
<color:#FF5555>Custom Hex Color Text</color>
```

**Click Events**

```
<click:open_url:"[https://yourserver.net](https://yourserver.net)">Visit our Webstore</click>
<click:run_command:"/discord">Join our Discord Community</click>
<click:suggest_command:"/msg %player% ">Click to send a private message</click>
```

**Hover Tooltips**

```
<hover:show_text:"<yellow>Click to view our server rules</yellow>"><underlined>Read Rules</underlined></hover>
```

#### Configuration Example

You can enable, disable, or adjust format templates for each tag inside `plugins/CoreChat/config.yml`:

```yaml
interactive-tags:
  item:
    enabled: true
    empty-hand-message: "<red>You must hold an item to use [item].</red>"
  pos:
    enabled: true
    format: "<gray>[<yellow>{world}</yellow> <white>{x}, {y}, {z}</white>]</gray>"
  ping:
    enabled: true
    format: "<gray>[Ping: {color}{ping}ms</gray>]"
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://corelab.gitbook.io/corelab-docs/interactive-tags-and-formatting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
