English | 简体中文
AConditionalPlaceholders is a flexible Minecraft Spigot plugin designed to allow administrators to create custom placeholders based on existing placeholder data and display them in-game. By configuring simple rules, you can build diverse conditional judgment systems that return different content based on players' in-game status (other placeholders, such as player balance %vault_eco_balance%).
- Lightweight: The plugin (including dependencies) is only about 2MB in size.
- Simple: Configuration file contains only 14 lines with detailed comments. Its structure (priority/conditions/results) is straightforward and suitable for absolute beginners.
- Flexible: Based on
SpEL(Spring Expression Language), enabling complex logic implementation.
- Download the prerequisite plugin
PlaceholderAPIto your server'spluginsfolder, then restart the server to ensure it runs properly. - Download this plugin to your server's
pluginsfolder and restart the server. - Open the custom placeholder configuration file
plugins/AConditionalPlaceholders/placeholders.ymland configure as needed. - Execute
/acp reloadcommand to activate the configured custom placeholders.
Example configuration file (placeholders.yml):
# 占位符名称 (%acpapi_你的名称%, 此处为test)
test:
- priority: 50 # 匹配的优先级 (越高越先匹配)
condition: "%vault_eco_balance% > 10000" # 通过匹配的条件 (支持PlaceholderAPI, 要求返回 Boolean (bool) 值) 若匹配则不会进行后面的匹配
result: "贵族玩家" # 若匹配则返回的占位符的对应结果
- priority: 10
condition: "%vault_eco_balance% > 1000"
result: "小康玩家"
- priority: 2
result: "if (%vault_eco_balance% == 0) '新玩家'" # 返回的结果支持表达式 (表达式中字符串要用''框住表示)
- priority: 1
result: "普通玩家"
This plugin is open-sourced under the LGPL-2.1 license. Please comply with the relevant regulations. All final interpretations belong to alazeprt.