MysticLib

Core shared library for all Mystic Minecraft plugins — provides database pooling, logging, plugin registry, and utilities.

8

Quick challenge

How far can you run before the mobs catch you?

MysticLib

🔮 MysticLib

Core shared library for all Mystic Minecraft plugins — provides database pooling, logging, plugin registry, and utilities.

---

Features

- 🗄️ Plugin Registry — HikariCP connection pool shared across all Mystic plugins. Configure once, use everywhere. - 📝 Plugin Registry — console output with log levels (`info`, `warn`, `error`, `success`). - 📋 Plugin Registry — Centralized startup display showing all registered Mystic plugins with version and load time.

Requirements

| Requirement | Version | |-------------|---------| | Paper / Purpur | 1.21.x+ | | Java | 21+ | | MySQL / MariaDB | 5.7+ / 10.2+ (*optional, runs in memory-only mode if disabled*) |

Installation

1. Download the latest `MysticLib-x.x.x.jar` from Releases. 2. Place it in your server's `plugins/` folder. 3. Start the server — MysticLib loads first automatically (`load: STARTUP`). 4. Configure database settings in `plugins/MysticLib/config.yml`. 5. Restart the server.

Configuration

The default config is generated at `plugins/MysticLib/config.yml`:

> Note: All Mystic plugins (MysticPlaceholders, etc.) share this single connection pool. You only configure the database once here.

Commands

| Command | Description | Permission | |---------|-------------|------------| | `/mysticlib reload` | Reload configuration | `mysticlib.admin` | | `/mysticlib status` | Show database status and registered plugins | `mysticlib.admin` |

Aliases: `/mlib`

API Reference

| Class | Key Methods | |-------|-------------| | `MysticLib` | `getInstance()`, `getDatabaseManager()`, `getPluginRegistry()`, `isDatabaseEnabled()` | | `DatabaseManager` | `getConnection()`, `executeAsync()`, `queryAsync()`, `isConnected()`, `shutdown()` | | `PluginRegistry` | `register()`, `unregister()`, `getRegisteredPlugins()`, `isRegistered()` | | `MysticLogger` | `info()`, `warn()`, `error()`, `success()`, `printPluginInfo()` | | `ColorUtil` | `gradient()`, `mysticGradient()`, `parse()`, `gradientComponent()`, `legacyToMiniMessage()` |

ADS