PlaceholderAPI Integration

Complete guide to using PlaceholderAPI placeholders in AnnouncementGUI announcements.

📋 Overview

AnnouncementGUI seamlessly integrates with PlaceholderAPI (PAPI), allowing you to create dynamic announcements with player-specific or server-specific information.

🎯 What is PlaceholderAPI?

PlaceholderAPI is a plugin that provides a unified system for displaying dynamic information from various plugins. It allows you to use placeholders like %player_name% or %vault_eco_balance% in your announcements.

📦 Installation

1

Install PlaceholderAPI

  • Download PlaceholderAPI:

    • https://www.spigotmc.org/resources/placeholderapi.6245/

    • https://github.com/PlaceholderAPI/PlaceholderAPI/releases

  • Install the plugin:

    • Place JAR in plugins/ folder

    • Restart server

  • Verify installation:

/papi version
2

Install Expansions

PlaceholderAPI requires expansions for specific plugins.

  • View available expansions:

/papi ecloud
  • Install common expansions:

/papi ecloud download Player
/papi ecloud download Server
/papi ecloud download Vault
/papi ecloud download LuckPerms
  • Reload PlaceholderAPI:

/papi reload
3

Verify AnnouncementGUI Integration

AnnouncementGUI automatically detects PlaceholderAPI.

  • Check console on startup:

[AnnouncementGUI] PlaceholderAPI found! Placeholder support enabled.

🎨 Using Placeholders

Basic Syntax

Placeholders use this format:

%<identifier>_<value>%

Examples:

  • %player_name% - Player's username

  • %vault_eco_balance% - Player's economy balance

  • %server_online% - Online player count

In Announcements

Simply include placeholders in your announcement messages.

Example 1: Welcome Message

Example 2: Server Stats

Example 3: Player Info

📚 Common Placeholders

Player Placeholders

Basic Player Info

Example Usage:

Server Placeholders

Server Statistics

Example Usage:

Economy Placeholders (Vault)

Requires:

  • Vault plugin

  • Economy plugin (e.g., EssentialsX, CMI)

  • Vault expansion: /papi ecloud download Vault

Example Usage:

Permission Placeholders (LuckPerms)

Requires:

  • LuckPerms plugin

  • LuckPerms expansion: /papi ecloud download LuckPerms

Example Usage:

Statistics Placeholders

Requires: Statistics expansion

Time Placeholders

Requires: Server expansion

🔧 Creating Dynamic Announcements

Example 1: Personalized Welcome

Goal: Welcome players with their name and balance.

Configuration:

Result:

Example 2: Rank-Based Messages

Goal: Show player's rank in announcements.

Configuration:

Result (for VIP):

Example 3: Server Status

Goal: Display current server statistics.

Configuration:

Example 4: Time-Based Greeting

Goal: Different greeting based on time.

Configuration:

Example 5: Achievement Encouragement

Goal: Show player progress.

Configuration:

⚡ Performance Considerations

Per-Player vs Broadcast Mode

AnnouncementGUI automatically detects placeholders and adjusts.

Broadcast Mode (No Placeholders):

  • Performance: Fast - one message for all players

  • Usage: Static announcements

Per-Player Mode (With Placeholders):

  • Performance: Slower - message parsed per player

  • Usage: Dynamic, personalized announcements

Optimization Tips

  1. Use sparingly: Don't use placeholders in every announcement

  2. Batch placeholders: Put all placeholders in one announcement

  3. Cache-friendly: Use server placeholders (cached) over player-specific ones

  4. Longer intervals: Use longer intervals for placeholder announcements

Example - Optimized:

🔍 Testing Placeholders

In-Game Testing

Test command:

Examples:

Common Placeholder Issues

Placeholder shows as-is

Example: Message shows %player_name% instead of "Steve"

Causes:

  • PlaceholderAPI not installed

  • Required expansion not installed

  • Syntax error in placeholder

Solutions:

Placeholder returns "Invalid placeholder"

Causes:

  • Expansion not installed

  • Incorrect placeholder syntax

  • Required plugin not installed

Solutions:

  1. Install required expansion

  2. Check placeholder spelling

  3. Verify required plugin is installed

Placeholder works in chat but not announcements

Causes:

  • AnnouncementGUI not detecting PlaceholderAPI

  • Plugin load order issue

Solutions:

  1. Check AnnouncementGUI console output

  2. Verify PlaceholderAPI in server.properties softdepend or depend

  3. Restart server (not reload)

📚 Expansion Library

Essential Expansions

Expansion
Plugin Required
Common Use

Player

None

Player info (%player_name%, etc.)

Server

None

Server stats (%server_online%, etc.)

Vault

Vault + Economy

Economy balance, groups

LuckPerms

LuckPerms

Permissions, ranks

Statistics

None

Player statistics

Expansion
Plugin Required
Placeholders

EssentialsX

EssentialsX

Homes, warps, balance

CMI

CMI

Various CMI features

Factions

Factions

Faction info

mcMMO

mcMMO

Skill levels

Jobs

Jobs

Job levels, balance

Towny

Towny

Town info

WorldGuard

WorldGuard

Region info

Marriage

Marriage

Partner info

Clans

Clans

Clan info

Installing Expansions

Method 1: In-Game (Recommended)

Method 2: Manual Download

  1. Visit https://api.extendedclip.com/expansions/

  2. Download expansion JAR

  3. Place in plugins/PlaceholderAPI/expansions/

  4. /papi reload

🎨 Advanced Techniques

Conditional Placeholders

Some expansions support conditional logic.

Example with Parse expansion:

Mathematical Operations

Example with Math expansion:

Relational Placeholders

Show info about two players:

JavaScript Placeholders

Example with JavaScript expansion:

🔧 Troubleshooting

Debug Mode

Enable debug mode in PlaceholderAPI config:

config.yml:

Then check console for placeholder parsing details.

Common Problems

Lag with placeholders

Solutions:

  1. Increase announcement interval

  2. Reduce number of placeholders

  3. Use cached placeholders (server stats)

  4. Update PlaceholderAPI and expansions

Outdated placeholder values

Solutions:

  1. Update expansion: /papi ecloud download <expansion>

  2. Reload PlaceholderAPI: /papi reload

  3. Check expansion update interval in config

Placeholder from plugin not working

Solutions:

  1. Verify plugin is running: /plugins

  2. Install correct expansion: /papi ecloud download <plugin>

  3. Check expansion compatibility with plugin version

  4. Restart server (don't just reload)

📖 Best Practices

  1. Test Before Deploying

Always test placeholders:

  1. Use Descriptive Names

  1. Balance Performance

  • Mix static and dynamic announcements

  • Don't overuse placeholders

  • Use appropriate intervals

  1. Keep Expansions Updated

  1. Document Dependencies

Keep a list of required expansions:

  1. Fallback Values

Some placeholders return empty when unavailable. Plan for this:

📝 Example Announcement Pack

1

Welcome Message (Static)

Name: Welcome - Static

2

Player Stats (Dynamic)

Name: Player Stats - PAPI

3

Server Info (Semi-Dynamic)

Name: Server Info - PAPI

4

Vote Reminder (Mixed)

Name: Vote Reminder - PAPI

🔗 Resources

  • PlaceholderAPI: https://github.com/PlaceholderAPI/PlaceholderAPI

  • Wiki: https://wiki.placeholderapi.com/

  • eCloud: https://api.extendedclip.com/expansions/

  • Discord: https://helpch.at/discord

Commands Reference