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
- Download PlaceholderAPI from Modrinth
- Place in your
pluginsfolder - Restart server
- 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
- Edit
config.yml:
boards:
default:
title:
text: "&b&lMy Server"
lines:
1:
text: "&eTPS: &f%clearlagenhanced_tps%"
- Reload:
/fb reload
TAB Plugin
- Edit
config.yml:
scoreboard-teams:
refresh-interval-milliseconds: 1000
placeholders:
- "%clearlagenhanced_tps%"
- "%clearlagenhanced_memory_percentage%"
- Reload:
/tab reload
DecentHolograms
- 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%%
- 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:
- Is PlaceholderAPI installed?
- Run
/papi listto verify ClearLaggEnhanced is registered - Test placeholder:
/papi parse me %clearlagenhanced_tps% - Check console for errors
Showing Literal Text
Problem: Shows %clearlagenhanced_tps% instead of value
Solution:
- Verify PlaceholderAPI is installed and enabled
- Restart server after installing both plugins
- Check if other placeholders work
- Ensure correct placeholder syntax (no spaces, exact name)
Value Not Updating
Problem: Placeholder shows old/stale value
Solution:
- Check plugin's refresh/update interval
- Some plugins cache placeholder values
- Try
/papi reloadto refresh PlaceholderAPI - Increase update frequency in scoreboard plugin
Performance Issues
Problem: Too many placeholders causing lag
Solution:
- Reduce update frequency in display plugin
- Limit number of placeholders used simultaneously
- Use static text where possible
- 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%");