Skip to content

About

A standalone Minecraft plugin for creating custom placeholders with PlaceholderAPI integration, Skript support, and MySQL/MariaDB storage.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”ฎ MysticPlaceholders

A standalone Minecraft plugin for creating custom placeholders with PlaceholderAPI integration, Skript support, and MySQL/MariaDB storage.

Features โ€ข Requirements โ€ข Installation โ€ข Configuration โ€ข Commands โ€ข Skript โ€ข Building


Features

  • Numeric Placeholders โ€” Store integer values like coins, tokens, kills, deaths, levels, mana, etc.
  • Text Placeholders โ€” Store string values like ranks, titles, factions, status, etc.
  • Max Value Caps โ€” Configure optional maximum limits per numeric placeholder.
  • PlaceholderAPI Integration โ€” Access placeholders via %mysticplaceholders_<name>%.
  • Skript Integration โ€” Full Skript addon with expressions, structures, and relational placeholder support.
  • MySQL/MariaDB Storage โ€” Persistent data via MysticLib's shared database connection (HikariCP pooling).
  • In-Memory Caching โ€” Fast O(1) lookups for online players with automatic cache lifecycle.
  • Async Database Operations โ€” All database writes are non-blocking, keeping your server lag-free.
  • MiniMessage Support โ€” Full support for modern MiniMessage color/gradient formatting.
  • Customizable Display โ€” Configure zero-display and normal-display formats per placeholder.
  • Thread Safe โ€” ConcurrentHashMap caching with atomic database upserts.

Requirements

Requirement Version
Paper / Purpur 1.21.x+
Java 21+
MysticLib 1.0.0+ (required โ€” provides database & logging)
Skript 2.8+ (required โ€” for Skript integration)
PlaceholderAPI 2.11+ (optional but recommended)
MySQL / MariaDB 5.7+ / 10.2+

Installation

  1. Download the latest MysticPlaceholders-x.x.x.jar from Releases.
  2. Ensure MysticLib and Skript are already installed on your server.
  3. Place the JAR in your server's plugins/ folder.
  4. Start/restart the server.
  5. Configure your placeholders in plugins/MysticPlaceholders/config.yml.
  6. Reload with /mplaceholder reload or restart the server.

Note: Database connection is configured in MysticLib's config.yml, not in this plugin. MysticPlaceholders uses MysticLib's shared database connection.

Configuration

The default config is generated at plugins/MysticPlaceholders/config.yml:

# Message prefix used in commands
prefix: '<gradient:#3E91FF:#C3C8FF><bold>MysticPlaceholders</bold></gradient> <dark_gray>ยป</dark_gray> '

# Enable/disable Skript addon integration
skript-integration: true

# Numeric placeholders โ€” store integer values
placeholders:
  coins:
    name: 'coins'
    zero-display: '<gray>0 Coins'
    normal-display: '<yellow>%value% <gold>Coins'
    # No max = unlimited

  level:
    name: 'level'
    zero-display: '<gray>Level 0'
    normal-display: '<green>Level %value%'
    max: 100  # Maximum level cap

  mana:
    name: 'mana'
    zero-display: '<gray>0'
    normal-display: '<aqua>%value%'
    max: 100  # Maximum mana cap

# Text placeholders โ€” store string values
placeholders-text:
  rank:
    name: 'rank'
    zero-display: '<gray>None'
    normal-display: '<gold>%value%'

  title:
    name: 'title'
    zero-display: ''
    normal-display: '<light_purple>%value%'

Adding Custom Placeholders

Numeric example:

placeholders:
  money:
    name: 'money'
    zero-display: '<gray>$0'
    normal-display: '<green>$%value%'
    max: 1000000  # Optional cap

Text example:

placeholders-text:
  guild:
    name: 'guild'
    zero-display: '<gray>No Guild'
    normal-display: '<blue>[%value%]'

Configuration Notes

  • Numeric placeholders: %value% is replaced with the number. Optional max caps the value.
  • Text placeholders: %value% is replaced with the stored string. Use null to clear.
  • Colors: Use MiniMessage format (<red>, <green>, <gradient:#hex1:#hex2>, etc.). Legacy & codes are auto-converted.
  • Text values: Underscores (_) in text values are converted to spaces.

Commands

Command Description Permission
/mplaceholder set <player> <placeholder> <value> Set a placeholder value mysticplaceholders.admin
/mplaceholder add <player> <placeholder> <value> Add to a numeric value mysticplaceholders.admin
/mplaceholder remove <player> <placeholder> <value> Remove from a numeric value mysticplaceholders.admin
/mplaceholder list List all configured placeholders mysticplaceholders.admin
/mplaceholder reload Reload configuration mysticplaceholders.admin

Aliases: /mph, /mysticph, /mplh

Placeholders

After installing PlaceholderAPI, use placeholders anywhere that supports PAPI:

%mysticplaceholders_coins%
%mysticplaceholders_tokens%
%mysticplaceholders_kills%
%mysticplaceholders_deaths%
%mysticplaceholders_level%
%mysticplaceholders_mana%
%mysticplaceholders_rank%
%mysticplaceholders_title%
%mysticplaceholders_faction%
%mysticplaceholders_status%

Skript Integration

MysticPlaceholders registers as a full Skript addon. Enable/disable via skript-integration: true in config.

Get / Set Values

# Get a placeholder value
set {_mana} to mystic placeholder "mana" of player

# Set a value
set mystic placeholder "mana" of player to 100

# Add to a value
add 25 to mystic placeholder "mana" of player

# Remove from a value
remove 10 from mystic placeholder "coins" of player

Define Custom Placeholders in Skript

mystic placeholder with the prefix "custom":
    if the identifier is "health_display":
        set the result to "&c%health of player%โค"

    if the identifier is "mana_bar":
        set {_mana} to mystic placeholder "mana" of player
        set the result to "&b%{_mana}%/100 โœฆ"

These are then usable as %custom_health_display% and %custom_mana_bar% via PlaceholderAPI.

Relational Placeholders

mystic relational placeholder with the prefix "rel":
    if the identifier is "compare_level":
        set {_l1} to mystic placeholder "level" of first player
        set {_l2} to mystic placeholder "level" of second player
        if {_l1} > {_l2}:
            set the result to name of the first player
        else:
            set the result to name of the second player

Database

MysticPlaceholders uses MysticLib's shared database connection โ€” you do not configure a database in this plugin.

How it works

  1. Configure your MySQL/MariaDB connection in plugins/MysticLib/config.yml.
  2. MysticPlaceholders automatically creates two tables:
    • mystic_placeholders_numeric โ€” Stores numeric placeholder values
    • mystic_placeholders_text โ€” Stores text placeholder values
  3. If the database is disabled in MysticLib, the plugin runs in memory-only mode (data is lost on restart).

Performance

  • HikariCP Connection Pool โ€” Industry-standard, high-performance JDBC pooling (via MysticLib).
  • Async Operations โ€” All database writes are asynchronous via CompletableFuture.
  • Atomic Upserts โ€” Uses INSERT ... ON DUPLICATE KEY UPDATE for safe concurrent writes.
  • Smart Caching โ€” Online player data is cached in ConcurrentHashMap for O(1) lookups.
  • Max Value Caps โ€” Enforced at both cache and database level using SQL LEAST().

Building

mvn clean package

The compiled JAR will be at target/MysticPlaceholders-1.0.0.jar.

Project Structure

MysticPlaceholders/
โ”œโ”€โ”€ src/main/java/com/mystic/placeholders/
โ”‚   โ”œโ”€โ”€ MysticPlaceholders.java          # Main plugin class
โ”‚   โ”œโ”€โ”€ CustomPlaceholder.java           # Numeric placeholder manager
โ”‚   โ”œโ”€โ”€ CustomPlaceholderText.java        # Text placeholder manager
โ”‚   โ”œโ”€โ”€ PlaceholderCommand.java          # Command handler with tab completion
โ”‚   โ”œโ”€โ”€ PlaceholderDatabaseManager.java  # Database operations (async)
โ”‚   โ”œโ”€โ”€ MysticPlaceholderExpansion.java   # PlaceholderAPI expansion
โ”‚   โ””โ”€โ”€ skript/                          # Skript addon integration
โ”‚       โ”œโ”€โ”€ SkriptAddonManager.java      # Addon lifecycle management
โ”‚       โ”œโ”€โ”€ SkriptPlaceholderRegistry.java
โ”‚       โ”œโ”€โ”€ SkriptPlaceholderExpansion.java
โ”‚       โ”œโ”€โ”€ PlaceholderEvent.java
โ”‚       โ”œโ”€โ”€ RelationalPlaceholderEvent.java
โ”‚       โ”œโ”€โ”€ PlaceholderEvaluator.java
โ”‚       โ”œโ”€โ”€ PlaceholderListener.java
โ”‚       โ””โ”€โ”€ elements/                    # Skript syntax elements
โ”‚           โ”œโ”€โ”€ ExprMysticPlaceholderValue.java
โ”‚           โ”œโ”€โ”€ ExprPlaceholder.java
โ”‚           โ”œโ”€โ”€ ExprPlaceholderResult.java
โ”‚           โ”œโ”€โ”€ ExprPlaceholderValue.java
โ”‚           โ”œโ”€โ”€ ExprRelationalPlaceholderPlayers.java
โ”‚           โ””โ”€โ”€ StructCustomPlaceholder.java
โ”œโ”€โ”€ src/main/resources/
โ”‚   โ”œโ”€โ”€ config.yml                       # Default configuration
โ”‚   โ””โ”€โ”€ plugin.yml                       # Plugin descriptor
โ”œโ”€โ”€ pom.xml
โ”œโ”€โ”€ LICENSE
โ””โ”€โ”€ README.md

License

This project is licensed under the MIT License.

Author

MysticFOX โ€” mysticfox.dev

About

A standalone Minecraft plugin for creating custom placeholders with PlaceholderAPI integration, Skript support, and MySQL/MariaDB storage.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages