ConditionalPlaceholders is a powerful Minecraft plugin that extends PlaceholderAPI by adding conditional logic to placeholders. It allows server administrators to create dynamic, condition-based content that changes based on placeholder values.
- Apply conditional logic to any PlaceholderAPI placeholder
- Support for multiple comparison operators:
=,!=,>,>=,<,<= - Define fallback values when no conditions match
- Easy to configure rule-based system
- Full color code support in outputs
- Folia compatible
- Java 21 or higher
- Paper/Spigot 1.20.4+
- PlaceholderAPI
- Quagmire Core
- Download the latest version of ConditionalPlaceholders
- Place the JAR file in your server's
pluginsfolder - Restart your server
- Configure the plugin using the
config.ymlfile
The basic syntax for using conditional placeholders is:
%conditional_rulename%
Where rulename is the name of a rule you've defined in the configuration.
Rules are defined in the config.yml file. Here's an example structure:
rules:
health_status:
placeholder: "%player_health%"
rules:
- "<=5;&#FF0000&lCRITICAL"
- "<=10;&#FF7F00&lLOW"
- "<=15;&#FFFF00&lMEDIUM"
- "*;�FF00&lHEALTHY"
rank_display:
placeholder: "%luckperms_primary_group_name%"
rules:
- "=admin;&#FF0000Administrator"
- "=mod;�FF00Moderator"
- "=vip;&#FFD700VIP Player"
- "*;&#AAAAAA Player"Each rule follows this format:
"condition;format"
- condition: The comparison operator and value to check against
- format: The text to display if the condition is met (supports colors and placeholders)
The wildcard condition * is used as a fallback when no other conditions match.
The following operators are supported:
=- Equal to!=- Not equal to>- Greater than>=- Greater than or equal to<- Less than<=- Less than or equal to
Display different messages based on player health:
Your health is %conditional_health_status%
Show rank-specific messages:
Welcome, %conditional_rank_display%!
Create conditional economy displays:
Balance: %conditional_money_display%
/conditionalplaceholdersor/cpl- Base command/cpl help- Shows the help menu/cpl reload- Reloads the plugin configuration
conditionalplaceholders.command- Permission to use basic plugin commandsconditionalplaceholders.reload- Permission to use the reload command
For developers looking to integrate with ConditionalPlaceholders, you can access the plugin instance and rule manager:
ConditionalPlaceholdersPlugin plugin = (ConditionalPlaceholdersPlugin) Bukkit.getPluginManager().getPlugin("ConditionalPlaceholders");
ConditionalRuleManager ruleManager = plugin.getRuleManager();If you encounter any issues or have questions, feel free to create an issue on our GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.
We welcome contributions to the project! If you'd like to contribute:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -am 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Author: Quagmire (me@quagmire.dev)