Описание
**DartPages** is a lightweight, high-performance, and maintainable interactive book system for Minecraft Spigot servers (supporting **1.18.2 through 26.2+**).
It enables administrators and players to create interactive written books featuring clickable links, commands, rich colors, formatting, and PlaceholderAPI placeholders through an intuitive chat composer or human-readable YAML files.
---
## Features
- 📝 **Chat-Based Book Composer**: Hold a Book and Quill (`Material.WRITABLE_BOOK`), type `/dpages`, and enter text line by line directly in chat.
- 🔗 **Clickable URLs**: Markdown syntax `[Label](https://example.com)` opens web links in the player's browser with safety checks.
- ⚡ **Clickable Commands**: Markdown syntax `[Label](/command)` executes commands directly as the player upon clicking.
- 🎨 **Full Color & Formatting**: Full support for legacy `&` color codes, formatting combinations (`&c&l[Text](/spawn)`), and Hex colors (`&#RRGGBB` or ``).
- 🔄 **PlaceholderAPI Integration**: Dynamic placeholders (`%player_name%`, `%statistic_deaths%`, etc.) stored literally in YAML and resolved in real-time when the book is read/rendered.
- 📄 **Smart Page Wrapping**: Automatic calculation of physical Minecraft book page boundaries without truncating text or corrupting Unicode characters.
- 🌍 **Multi-Language Support**: Fully localized out of the box in **English (`en_US`)**, **Russian (`ru_RU`)**, **Spanish (`es_ES`)**, and **Chinese (`zh_CN`)**.
- 🛡️ **Zero Bloat & Secure**: No external databases, no NMS dependencies, no packet libraries, and configurable URL scheme/command security rules.
---
## Directory Structure
```text
plugins/DartPages/
├── config.yml
├── books/
│ └── example_book.yml
└── languages/
├── en_US.yml
├── ru_RU.yml
├── es_ES.yml
└── zh_CN.yml
```
---
## Commands & Aliases
Primary command: `/dpages` (Aliases: `/dartpages`, `/dpage`, `/dartpage`, `/dpg`)
| Command | Permission | Description |
| :--- | :--- | :--- |
| `/dpages [create]` | `dartpages.create` | Start interactive book creation session in chat (must hold Book and Quill). |
| `/dpages give ` | `dartpages.give` | Give a rendered custom book to a player. |
| `/dpages list` | `dartpages.list` | List all available registered books. |
| `/dpages info ` | `dartpages.info` | Display detailed metadata and line/page statistics. |
| `/dpages edit ` | `dartpages.edit` | Load an existing book into an interactive chat edit session. |
| `/dpages delete [confirm]` | `dartpages.delete` | Delete a book definition safely. |
| `/dpages reload` | `dartpages.reload` | Reload `config.yml`, language files, and all books. |
| `/dpages help` | `dartpages.admin` | Display command help overview. |
---
## Permissions
| Permission | Description | Default |
| :--- | :--- | :--- |
| `dartpages.admin` | Grants access to all DartPages administrative commands. | `op` |
| `dartpages.create` | Allows starting interactive book creation in chat. | `op` |
| `dartpages.give` | Allows giving books to players. | `op` |
| `dartpages.list` | Allows listing books. | `op` |
| `dartpages.info` | Allows inspecting book information. | `op` |
| `dartpages.edit` | Allows editing books via chat. | `op` |
| `dartpages.delete` | Allows deleting custom books. | `op` |
| `dartpages.reload` | Allows reloading plugin configurations. | `op` |
---
## Interactive Syntax Guide
### 1. Clickable URLs
```text
Visit our [Official Website](https://example.com) for updates!
```
### 2. Clickable Commands
```text
Click [Teleport to Spawn](/spawn) or [Open Menu](/menu)
```
### 3. Colors and Formatting with Links
```text
&a&l[Claim Free Reward](/kit starter)
&c&l[Dangerous PvP Arena](/warp pvp)
```
### 4. Dynamic Placeholders
```text
Welcome, &e%player_name%&r! Your balance is &a$%vault_eco_balance%.
```
---
## YAML Book Format (`books/example_book.yml`)
```yaml
id: "example_book"
title: "&6&lServer Guide"
author: "DartPages"
lore:
- "&7Interactive server guide"
- "&eRight-click to read"
pages:
- lines:
- "&6&lWelcome!"
- "&rHello %player_name%!"
- ""
- "Visit our [website](https://example.com)"
- "&l[Home](/home)"
- "&a[Spawn](/spawn)"
- lines:
- "&b&lUseful Commands:"
- "&7- [Home](/home) &8(Teleport)"
- "&7- [Spawn](/spawn) &8(Main hub)"
- "&7- [Menu](/menu) &8(Server GUI)"
- ""
- "&dCreated with DartPages."
```
---
## Configuration (`config.yml`)
```yaml
language: "en_US"
input:
finish-keyword: "EOF"
next-page-keyword: "NEXT_PAGE"
cancel-keyword: "CANCEL"
overwrite-keyword: "OVERWRITE"
timeout-seconds: 300
max-lines: 65536
book:
max-pages: 50
max-page-characters: 256
default-author: "DartPages"
give:
drop-if-inventory-full: true
placeholderapi:
enabled: true
keep-unresolved: true
interaction:
hover:
command: "&7Click to execute &f/%command%"
url: "&7Click to open &f%url%"
security:
allowed-url-schemes:
- "http"
- "https"
commands:
enabled: true
mode: "ALLOW_ALL" # ALLOW_ALL, ALLOWLIST, DENYLIST
allowed: []
denied:
- "op"
- "deop"
- "stop"
- "reload"
debug:
enabled: false
```