PlaceholderAPI

ClearLaggEnhanced provides rich PlaceholderAPI support for displaying statistics and information in other plugins.

Setup

Requirements

  • PlaceholderAPI must be installed
  • ClearLaggEnhanced will automatically detect and register placeholders
  • No additional configuration needed

Installation

  1. Download PlaceholderAPI from Modrinth
  2. Place in your plugins folder
  3. Restart server
  4. ClearLaggEnhanced automatically registers placeholders

Verification

Check if placeholders are registered:

/papi ecloud list clearlagenhanced

Available Placeholders

Performance Placeholders

TPS (Ticks Per Second)

%clearlagenhanced_tps%

Description: Current server TPS as a decimal

Example Output: 19.85

Usage: Display current server performance

Scoreboard example:

- "TPS: %clearlagenhanced_tps%"

Memory Used

%clearlagenhanced_memory_used%

Description: Used memory in megabytes

Example Output: 2048

Usage: Show how much RAM is currently in use

Tab list example:

- "RAM: %clearlagenhanced_memory_used%MB"

Memory Max

%clearlagenhanced_memory_max%

Description: Maximum allocated memory in megabytes

Example Output: 4096

Usage: Show total server RAM allocation

Display example:

- "%clearlagenhanced_memory_used%/%clearlagenhanced_memory_max% MB"

Memory Percentage

%clearlagenhanced_memory_percentage%

Description: Memory usage as a percentage

Example Output: 50.0

Usage: Show memory usage percentage

Progress bar example:

- "Memory: %clearlagenhanced_memory_percentage%% used"

Entity Statistics

Total Entities

%clearlagenhanced_entities_total%

Description: Total number of entities on the server

Example Output: 1250

Usage: Display entity count across all worlds

Hologram example:

- "Entities: %clearlagenhanced_entities_total%"

Timer Placeholders

Next Clear Countdown

%clearlagenhanced_next_clear%

Description: Seconds until next automatic entity clear

Example Output: 180

Usage: Show countdown timer

Format example:

- "Next clear: %clearlagenhanced_next_clear%s"

Usage Examples

Scoreboards (FeatherBoard)

scoreboard:
  title: "&b&lServer Stats"
  lines:
    - ""
    - "&eTPS: &f%clearlagenhanced_tps%"
    - "&eMemory: &f%clearlagenhanced_memory_percentage%"
    - "&eEntities: &f%clearlagenhanced_entities_total%"
    - ""
    - "&6Next Clear: &f%clearlagenhanced_next_clear%s"

Tab List (TAB)

tablist:
  header:
    - "&b&lMy Server"
    - "&7TPS: &f%clearlagenhanced_tps%"
  footer:
    - "&7RAM: &f%clearlagenhanced_memory_used%&7/&f%clearlagenhanced_memory_max% &7MB"
    - "&7Next clear in &f%clearlagenhanced_next_clear% &7seconds"

Holograms (DecentHolograms)

holograms:
  server-stats:
    lines:
      - "&b&lServer Statistics"
      - ""
      - "&eTPS: &f%clearlagenhanced_tps%"
      - "&eMemory: &f%clearlagenhanced_memory_percentage%%"
      - "&eEntities: &f%clearlagenhanced_entities_total%"

Chat Formatting (DeluxeChat)

format: "&7[&eTPS: %clearlagenhanced_tps%&7] {PREFIX}{USERNAME}&7: {MESSAGE}"

Animated Scoreboards

TPS with Color Coding

Use conditional formatting in scoreboard plugins:

lines:
  - "&eTPS:"
  - "{tps_color}%clearlagenhanced_tps%"

Where {tps_color} is calculated based on TPS value:

  • Green (20.0): &a
  • Yellow (15-19): &e
  • Red (<15): &c

Memory Usage Bar

Create a visual progress bar:

lines:
  - "&eMemory Usage:"
  - "&f{memory_bar} &7%clearlagenhanced_memory_percentage%%"

BossBar (BossBarAPI)

bars:
  performance:
    text: "&eTPS: %clearlagenhanced_tps% &7| &eRAM: %clearlagenhanced_memory_percentage%%"
    color: "GREEN"
    style: "SOLID"

Plugin Compatibility

Tested and Working

Plugin Purpose Compatibility
FeatherBoard Scoreboards āœ… Full
TAB Tab list āœ… Full
DecentHolograms Holograms āœ… Full
FancyHolograms Holograms āœ… Full
DeluxeChat Chat formatting āœ… Full
BossBarAPI Boss bars āœ… Full
AnimatedScoreboard Scoreboards āœ… Full

Setup with Popular Plugins

FeatherBoard

  1. Edit config.yml:
boards:
  default:
    title:
      text: "&b&lMy Server"
    lines:
      1:
        text: "&eTPS: &f%clearlagenhanced_tps%"
  1. Reload: /fb reload

TAB Plugin

  1. Edit config.yml:
scoreboard-teams:
  refresh-interval-milliseconds: 1000
  placeholders:
    - "%clearlagenhanced_tps%"
    - "%clearlagenhanced_memory_percentage%"
  1. Reload: /tab reload

DecentHolograms

  1. Create hologram:
/dh create stats
/dh line add stats &b&lServer Stats
/dh line add stats &eTPS: &f%clearlagenhanced_tps%
/dh line add stats &eRAM: &f%clearlagenhanced_memory_percentage%%
  1. Auto-updates every few seconds

Advanced Usage

Conditional Displays

Show warnings when TPS drops:

lines:
  - "&eTPS: &f%clearlagenhanced_tps%"
  - "%tps_warning%"  # Custom placeholder that shows warning if TPS < 15

Combined Statistics

Combine multiple placeholders:

line: "&7[&eTPS: %clearlagenhanced_tps% &7| &eRAM: %clearlagenhanced_memory_percentage%% &7| &eEntities: %clearlagenhanced_entities_total%&7]"

Countdown Timer Formatting

Convert seconds to minutes:seconds format using math placeholders:

next-clear: "Next clear: %clearlagenhanced_next_clear%s"

Or use PlaceholderAPI's Math expansion:

Next clear: %math_0_{clearlagenhanced_next_clear}/60%:%math_0_{clearlagenhanced_next_clear}%60%

Troubleshooting

Placeholders Not Working

Check these:

  1. Is PlaceholderAPI installed?
  2. Run /papi list to verify ClearLaggEnhanced is registered
  3. Test placeholder: /papi parse me %clearlagenhanced_tps%
  4. Check console for errors

Showing Literal Text

Problem: Shows %clearlagenhanced_tps% instead of value

Solution:

  1. Verify PlaceholderAPI is installed and enabled
  2. Restart server after installing both plugins
  3. Check if other placeholders work
  4. Ensure correct placeholder syntax (no spaces, exact name)

Value Not Updating

Problem: Placeholder shows old/stale value

Solution:

  1. Check plugin's refresh/update interval
  2. Some plugins cache placeholder values
  3. Try /papi reload to refresh PlaceholderAPI
  4. Increase update frequency in scoreboard plugin

Performance Issues

Problem: Too many placeholders causing lag

Solution:

  1. Reduce update frequency in display plugin
  2. Limit number of placeholders used simultaneously
  3. Use static text where possible
  4. Consider using fewer holograms/scoreboards

API for Developers

If you're developing a plugin that needs these values:

import me.clip.placeholderapi.PlaceholderAPI;

String tps = PlaceholderAPI.setPlaceholders(player, "%clearlagenhanced_tps%");
String memory = PlaceholderAPI.setPlaceholders(player, "%clearlagenhanced_memory_used%");