Placeholders
All available placeholders in zMenu
zMenu provides built-in placeholders and supports PlaceholderAPI for dynamic content in your inventories.
Built-in Placeholders
These placeholders are available without any additional plugins:
Player Placeholders
| Placeholder | Description | Example Output |
|---|---|---|
%player% | Player's name | Notch |
Pagination Placeholders
| Placeholder | Description | Example Output |
|---|---|---|
%page% | Current page number | 1 |
%maxPage% | Maximum page number | 5 |
%max-page% | Maximum page number (alias) | 5 |
%zmenu_player_page% | Current page (PAPI format) | 1 |
%zmenu_player_next_page% | Next page number | 2 |
%zmenu_player_previous_page% | Previous page number | 0 |
%zmenu_player_max_page% | Maximum page (PAPI format) | 5 |
Inventory History Placeholders
| Placeholder | Description | Example Output |
|---|---|---|
%zmenu_player_previous_inventories% | Number of previous inventories in history | 3 |
Math Placeholders
Perform calculations directly in your configuration:
| Placeholder | Description | Example |
|---|---|---|
%zmenu_math_<expression>% | Calculate a math expression | %zmenu_math_5+5% → 10 |
%zmenu_formatted_math_<expression>% | Formatted math result | %zmenu_formatted_math_1000+500% → 1,500 |
Supported Operations:
- Addition:
+ - Subtraction:
- - Multiplication:
* - Division:
/ - Parentheses:
()
Examples:
lore:
- "&7Result: %zmenu_math_10*5%" # Output: 50
- "&7Balance: %zmenu_formatted_math_{vault_eco_balance}*2%"Player Data Placeholders
| Placeholder | Description |
|---|---|
%zmenu_player_value_<key>% | Get player data value |
Example:
lore:
- "&7Coins: &6%zmenu_player_value_coins%"
- "&7Kills: &c%zmenu_player_value_kills%"Command Argument Placeholders
| Placeholder | Description |
|---|---|
%zmenu_argument_<key>% | Get command argument value |
This placeholder retrieves arguments passed through custom commands configured in zMenu.
Example:
Command configuration:
# In commands/commands.yml
commands:
punish:
command: punish
arguments:
- player
inventory: example_punishUsing the argument in your inventory:
items:
player-info:
item:
material: PLAYER_HEAD
playerHead: "%zmenu_argument_player%"
name: "&cPunish %zmenu_argument_player%"
lore:
- "&7Click to punish this player"When a player runs /punish Notch, the placeholder %zmenu_argument_player% will return Notch.
Global Placeholder Placeholders
| Placeholder | Description |
|---|---|
%zmenu_global_placeholders_<key>% | Get global placeholder value |
Example:
# In global-placeholders.yml
server-name: "My Server"
# In inventory
name: "&6%server-name%" # Replacing directly when zMenu load the inventoryTime Placeholders
| Placeholder | Description | Example Output |
|---|---|---|
%zmenu_time_unix_timestamp% | Current Unix timestamp (in seconds) | 1704067200 |
%zmenu_time_next_day_unix_timestamp% | Tomorrow's Unix timestamp (in seconds) | 1704153600 |
%zmenu_time_today_start_unix_timestamp% | Start of today timestamp (in seconds) | 1704067200 |
Item Inspection Placeholders
Inspect properties of any item in the menu or the player's inventory.
Syntax: %zmenu_item_<source>:<slot>_<property>%
Sources:
| Source | Description |
|---|---|
inventory | A slot in the currently open zMenu inventory |
player | A slot in the player's inventory (0–35) |
armor | A player's armor slot (helmet, chestplate, leggings, boots) |
Available properties:
| Property | Description |
|---|---|
is_player_item | true if the item was placed there by the player |
is_zmenu_item | true if the item belongs to the zMenu interface |
material | Material name (e.g. DIAMOND) |
amount | Stack size |
dura | Current durability |
max_dura | Maximum durability |
name | Display name |
lore | Full lore (joined) |
custommodeldata | Custom model data value |
enchantments | Comma-separated list of enchantments |
flags | Comma-separated item flags |
unbreakable | true if unbreakable |
potion_type | Potion type name |
potion_extended | true if extended |
potion_upgraded | true if upgraded |
custom_potion_effects | Custom potion effect list |
banner_patterns | Banner pattern list |
firework_power | Firework power |
firework_effects | Firework effect list |
skull_owner | Player head owner name |
leather_color | Leather armour dye colour |
book_title | Book title |
book_author | Book author |
book_pages | Book page count |
stored_enchantments | Enchantments stored in a book |
armor_trim | Armour trim material/pattern |
Examples:
lore:
- "&7Slot 13 material: %zmenu_item_inventory:13_material%"
- "&7Helmet: %zmenu_item_armor:helmet_material%"
- "&7Player slot 0 amount: %zmenu_item_player:0_amount%"
# Check if a drag slot has the right item
click-requirement:
check:
clicks:
- ALL
requirements:
- type: placeholder
placeholder: "%zmenu_item_inventory:13_material%"
action: EQUALS_STRING
value: "DIAMOND"
deny:
- type: message
messages:
- "&cPlace a diamond in the slot!"Player Inventory Placeholders
These placeholders are especially useful when the bottom inventory is hidden with clear-inventory: true, allowing you to check inventory space before giving items (e.g., in shop menus).
| Placeholder | Description | Example Output |
|---|---|---|
%zmenu_player_empty_slots% | Number of free slots in the player's inventory | 12 |
%zmenu_player_item_count_<MATERIAL>% | Total amount of a specific item in the inventory | 64 |
Examples:
# Display free slots in lore
lore:
- "&7Free slots: &a%zmenu_player_empty_slots%"
- "&7Diamonds: &b%zmenu_player_item_count_DIAMOND%"
# Prevent purchase when inventory is full
click-requirement:
requirement:
clicks:
- ALL
requirements:
- type: placeholder
placeholder: "%zmenu_player_empty_slots%"
action: SUPERIOR_OR_EQUAL
value: 1
deny:
- type: message
messages:
- "&cYour inventory is full!"Statistic Placeholders
| Placeholder | Description | Example Output |
|---|---|---|
%zmenu_statistic_hours_played% | Hours played (rounded) | 42 |
%zmenu_statistic_time_played% | Formatted playtime | 1d 18h 30m |
PlaceholderAPI Integration
zMenu fully supports PlaceholderAPI. Any PAPI placeholder works in:
- Inventory titles
- Item names
- Item lore
- Messages
- Requirements
- Actions
Popular PlaceholderAPI Expansions
Install expansions with: /papi ecloud download <name>
| Expansion | Placeholders | Example |
|---|---|---|
| Player | %player_name%, %player_health%, %player_level% | %player_name% → Notch |
| Vault | %vault_eco_balance%, %vault_eco_balance_formatted% | %vault_eco_balance% → 1500.00 |
| Statistic | %statistic_deaths%, %statistic_kills% | %statistic_deaths% → 42 |
| Server | %server_online%, %server_max_players% | %server_online% → 50 |
| LuckPerms | %luckperms_prefix%, %luckperms_primary_group_name% | %luckperms_prefix% → [Admin] |
Using PlaceholderAPI
items:
profile:
slot: 4
item:
material: PLAYER_HEAD
playerHead: "%player_name%"
name: "&6%player_name%'s Profile"
lore:
- "&8&m─────────────────"
- ""
- "&7Health: &c%player_health%&7/&c%player_max_health%"
- "&7Level: &a%player_level%"
- "&7Balance: &6$%vault_eco_balance_formatted%"
- ""
- "&7Kills: &a%statistic_player_kills%"
- "&7Deaths: &c%statistic_deaths%"
- ""
- "&8&m─────────────────"Local Placeholders
Define placeholders specific to an inventory:
# In your inventory file
local-placeholders:
price: "100"
item-name: "Special Sword"
items:
shop-item:
item:
name: "&6%item-name%"
lore:
- "&7Price: &a$%price%"Placeholder Modifiers
zMenu's own placeholders (command arguments, %page%, %player%, Bedrock form inputs, dialog inputs...) can be transformed directly in the placeholder, by adding one or more modifiers after a dot:
# /shop <category>
- "&7Category: &f%category.capitalize%" # weapons -> Weapons
- "&7Page &f%page.pad:2%" # 3 -> 03
- "&7Name: &f%name.trim.max:16%" # modifiers can be chained
- "&7Amount: &f%amount.default:1%" # 1 when the argument is empty
- "console-command: give %player% diamond %amount.int.safe%"| Modifier | Example | Result |
|---|---|---|
upper / lower | %name.upper% | Upper / lower case |
capitalize | %name.capitalize% | First letter upper case, the rest lower case |
trim | %name.trim% | Removes surrounding spaces |
length | %name.length% | Number of characters |
empty | %name.empty% | true when blank |
isnumber | %amount.isnumber% | true when the value is a number |
safe | %name.safe% | Removes ;, &, § and line breaks (safe to put in a command) |
default:<value> | %amount.default:1% | <value> when blank |
max:<n> | %name.max:16% | Cut to <n> characters |
pad:<n> | %page.pad:3% | Left-padded with zeros to <n> characters |
int, round, floor, ceil | %price.round% | Whole number |
abs | %value.abs% | Absolute value |
negative, even | %value.even% | true / false |
0f, 1f, 2f, 3f | %price.2f% | Number with 0 to 3 decimals |
comma | %price.comma% | Thousands separator (1,234,567) |
add_one, remove_one | %page.add_one% | Value + 1 / - 1 |
add:<n>, sub:<n> | %page.add:10% | Value + n / - n |
An unknown modifier, a missing argument or a numeric modifier applied to a non-numeric value gives an empty result. The previous prefixes (%upper_key%, %lower_key%, %capitalize_key%, %add_one_key%, %remove_one_key%) still work.
Modifiers apply to zMenu's own placeholders, not to PlaceholderAPI placeholders. For PlaceholderAPI, use the formatting options of the expansion.
Placeholder Caching
For better performance, you can enable placeholder caching in config.yml:
# Enable PlaceholderAPI caching
enable-cache-placeholder-api: true
# Cache duration in ticks (20 ticks = 1 second)
cache-placeholder-api: 20Caching means placeholders won't update instantly. Only enable this if you have performance issues and understand the implications.
Nested Placeholders
You can use placeholders inside other placeholders:
# Using player data in math
lore:
- "&7Double coins: %zmenu_math_{zmenu_player_value_coins}*2%"Requirements with Placeholders
Use placeholders in requirements to create dynamic conditions:
click-requirement:
requirement:
clicks:
- ALL
requirements:
- type: placeholder
placeholder: "%vault_eco_balance%"
action: SUPERIOR_OR_EQUAL
value: 100
deny:
- type: message
messages:
- "&cYou need at least $100!"Placeholder Formatting
Numbers
For formatted numbers, use the _formatted variants when available:
%vault_eco_balance_formatted%instead of%vault_eco_balance%%zmenu_formatted_math_<expr>%instead of%zmenu_math_<expr>%
Colors in Placeholders
Some placeholders include color codes. To strip them:
name: "%luckperms_prefix% %player_name%" # Keeps colorsDebugging Placeholders
If placeholders aren't working:
-
Check PlaceholderAPI is installed
/papi info -
Test the placeholder
/papi parse me %placeholder_name% -
Check the expansion is installed
/papi list -
Install missing expansions
/papi ecloud download <expansion> /papi reload
Quick Reference Table
| Category | Placeholder | Description |
|---|---|---|
| Player | %player% | Player name |
| Page | %page% | Current page |
| Page | %maxPage% | Max page |
| Math | %zmenu_math_<expr>% | Calculate expression |
| Data | %zmenu_player_value_<key>% | Player data |
| Argument | %zmenu_argument_<key>% | Command argument |
| Global | %zmenu_global_placeholders_<key>% | Global value |
| Time | %zmenu_time_unix_timestamp% | Unix time |
| Inventory | %zmenu_player_empty_slots% | Free slots |
| Inventory | %zmenu_player_item_count_<MAT>% | Item count |
| Stats | %zmenu_statistic_hours_played% | Hours played |
Next Steps
- Learn about Global Placeholders
- Set up Player Data for custom values
- Create dynamic Requirements