MyPlaceholderOverride is a lightweight plugin that enhances PlaceholderAPI by letting you create custom, conditional placeholders.
Notice: This plugin is in its early development stages. Performance and features may not be fully optimized yet. Please use with caution and feel free to provide feedback or report issues on discord:
itsokitask
Here an online tool to help you generate your config.yml file for MyPlaceholderOverride quickly and easily.
https://okitaskdev.github.io/MyPlaceholderOverride/
Key Features:
- Create dynamic placeholders based on multiple conditions.
- Use AND/OR logic to combine conditions.
- Store rules in YAML or MySQL, with automatic fallback.
- Debug mode to track placeholder processing.
- Detailed live statistics via /mpo stats (cache hit rate, rule effectiveness, health score).
- Commands: /mpo reload, /mpo stats, /mpo test <player> <placeholder>, /mpo clearcache [player].
Config.yml file (with examples how to use it)
Code (YAML):
# Storage Configuration:
# Determines whether to use YAML or MySQL for storing placeholder rules.
storage:
use-mysql
: false
mysql:
host
: localhost
port
: 3306
database
: placeholderoverride
username
: root
password
:
""
# ── Cache ─────────────────────────────────────────────────────────
# cache-ttl-seconds:
# How long (in seconds) a resolved placeholder value is kept in cache
# before being re-evaluated. Lower = more accurate but more CPU load.
# Higher = better performance but slower reaction to changes.
# Default: 5
cache-ttl-seconds
: 5
# cache-max-size-per-player: ← NEW
# Maximum number of placeholder entries stored in cache per player.
# When the limit is reached, the least-recently-used entry is evicted
# automatically. Increase this if you have many different
# placeholders per player; decrease it to save memory on large servers.
# Default: 100
cache-max-size-per-player
: 100
# ── Debug ─────────────────────────────────────────────────────────
# Enable debug logging for rule matching and cache eviction details.
# Disable in production to reduce log noise.
debug
: false
# Rules Section:
# The 'rules' section is the core of the plugin's configuration. It defines a set of rules, each identified by a
# unique key (e.g., 'example_rule_1'). Each rule specifies a placeholder to override, how to evaluate conditions,
# and what value to return if the conditions are satisfied.
# Structure of a Rule:
# - placeholder: The PlaceholderAPI placeholder to override (e.g., '%player_name%'). This is the placeholder
# whose output will be replaced if the rule's conditions are met. It must be a valid PlaceholderAPI placeholder.
# - priority: An integer determining the evaluation order when multiple rules target the SAME placeholder.
# Rules with higher priority values (e.g., 10) are evaluated BEFORE rules with lower values (e.g., 1).
# If not specified, the default priority is 0.
# - logic: Specifies how multiple conditions are combined. Options are:
# - 'and': All conditions must be true for the rule to apply.
# - 'or': At least one condition must be true for the rule to apply.
# Default is 'and' if not specified.
# - conditions: A section containing one or more conditions, each with a unique key (e.g., 'condition1').
# Each condition defines:
# - placeholder: The placeholder to evaluate for this condition. If not specified, defaults to the rule's
# 'placeholder'. This allows checking different placeholders within the same rule.
# - type: The type of comparison to perform. Supported types are:
# - 'equals': Checks if the placeholder's output exactly matches the specified value (case-insensitive).
# - 'not_equals': Checks if the placeholder's output does NOT match the specified value (case-insensitive).
# - 'contains': Checks if the placeholder's output contains the specified value (case-insensitive).
# - 'not_contains': Checks if the placeholder's output does NOT contain the specified value (case-insensitive).
# - 'number_equals': Checks if the placeholder's output is numerically equal to the specified value.
# - 'number_not_equals': Checks if the placeholder's output is NOT numerically equal to the specified value.
# - 'greater_than': Checks if the placeholder's output is numerically greater than the specified value.
# - 'less_than': Checks if the placeholder's output is numerically less than the specified value.
# - value: The value to compare the placeholder's output against.
# - return_value: The value to return if the rule's conditions are met. If the conditions are not met,
# the original placeholder output is returned.
# Usage Notes:
# - To use an overridden placeholder, prefix it with 'override_' in PlaceholderAPI-enabled plugins.
# Example: For a rule overriding '%player_name%', use '%override_player_name%' to get the overridden value.
# - Nested placeholders are supported because the plugin uses PlaceholderAPI to resolve placeholders.
# - If a placeholder returns null, NOT_EQUALS, NOT_CONTAINS, and NUMBER_NOT_EQUALS conditions will evaluate to true.
# - If a rule or condition is invalid (e.g., missing fields, incorrect condition type), it is logged and ignored.
# - Numerical comparisons will fail silently if the placeholder output or condition value cannot be parsed as a number.
# Example Configuration:
rules
:
# Rule 1: Overrides %player_name% if the player is in the nether and their name is "Notch"
example_rule_1:
placeholder
:
"%player_name%"
priority
: 10
logic
:
"and"
conditions:
condition1:
placeholder
:
"%player_name%"
type
:
"equals"
value
:
"Notch"
condition2:
placeholder
:
"%player_world%"
type
:
"contains"
value
:
"nether"
return_value
:
"NetherNotch"
# Rule 2: Overrides %vault_balance% if balance is 1000 or 2000
example_rule_2:
placeholder
:
"%vault_balance%"
priority
: 5
logic
:
"or"
conditions:
condition1:
type
:
"number_equals"
value
:
"1000"
condition2:
type
:
"number_equals"
value
:
"2000"
return_value
:
"Rich"
# Rule 3: Overrides %player_world% if NOT in nether (using NOT_CONTAINS)
example_rule_3:
placeholder
:
"%player_world%"
logic
:
"and"
conditions:
condition1:
type
:
"not_contains"
value
:
"nether"
return_value
:
"SafeZone"
# Rule 4: Checks multiple placeholders with OR logic
example_rule_4:
placeholder
:
"%player_group%"
priority
: 20
logic
:
"or"
conditions:
condition1:
placeholder
:
"%luckperms_prefix%"
type
:
"contains"
value
:
"Admin"
condition2:
placeholder
:
"%vault_balance%"
type
:
"number_equals"
value
:
"5000"
return_value
:
"Elite"
# Rule 5: Overrides %player_level% if the player's experience level is greater than 30
example_rule_5:
placeholder
:
"%player_level%"
priority
: 5
logic
:
"and"
conditions:
condition1:
type
:
"greater_than"
value
:
"30"
return_value
:
"Veteran"
# Rule 6: High Priority Health Check
example_rule_6:
placeholder
:
"%player_health%"
priority
: 10
logic
:
"and"
conditions:
condition1:
type
:
"less_than"
value
:
"5"
return_value
:
"Critical"
# Rule 7: Lower Priority Health Check
example_rule_7:
placeholder
:
"%player_health%"
priority
: 5
logic
:
"and"
conditions:
condition1:
type
:
"less_than"
value
:
"10"
return_value
:
"Low"
# Rule 8: Example using NOT_EQUALS - Overrides if player is NOT named "Steve"
example_rule_8:
placeholder
:
"%player_displayname%"
priority
: 3
logic
:
"and"
conditions:
condition1:
placeholder
:
"%player_name%"
type
:
"not_equals"
value
:
"Steve"
return_value
:
"NotSteve"
# Rule 9: Example using NUMBER_NOT_EQUALS - Overrides if balance is NOT 0
example_rule_9:
placeholder
:
"%vault_balance%"
priority
: 2
logic
:
"and"
conditions:
condition1:
type
:
"number_not_equals"
value
:
"0"
return_value
:
"HasMoney"
# Rule 10: Complex example - VIP status if NOT banned AND NOT in creative
example_rule_10:
placeholder
:
"%player_status%"
priority
: 15
logic
:
"and"
conditions:
condition1:
placeholder
:
"%player_is_banned%"
type
:
"not_equals"
value
:
"true"
condition2:
placeholder
:
"%player_gamemode%"
type
:
"not_equals"
value
:
"CREATIVE"
condition3:
placeholder
:
"%vault_balance%"
type
:
"greater_than"
value
:
"10000"
return_value
:
"VIP"
# Additional Notes:
# - The NOT_EQUALS, NOT_CONTAINS, and NUMBER_NOT_EQUALS types return true when a placeholder is null/doesn't exist.
# - Ensure PlaceholderAPI is installed, as this plugin depends on it.
# - Add as many rules and conditions as needed, each with a unique key.
# - Use unique keys for conditions to avoid conflicts.
# - For numerical comparisons, ensure the placeholder returns a valid number.
# - Test rules with '/papi parse %override_<placeholder>%' to verify behavior.
# - After modifying this file, use '/myplaceholderoverride reload' to apply changes without restarting the server.
T.O.S
You cannot sell this plugin.
You can't decompile it.
You cannot use parts of the plugin code.
You can't take this plugin as your own