Aller au contenu principal

Placeholders

zDrawer provides placeholders for use in drawer item lore and with PlaceholderAPI.

Internal Placeholders

These placeholders work in drawer item configuration (lore):

PlaceholderDescription
%zdrawer_content_<index>%Item name stored in slot
%zdrawer_amount_<index>%Raw amount in slot
%zdrawer_amount_formatted_<index>%Formatted amount (e.g., 1.5K)
%zdrawer_upgrade%Applied upgrade name

Index Values

The <index> is 0-based:

IndexSlot
0First slot
1Second slot
2Third slot
3Fourth slot

Usage in Drawer Lore

item:
material: BARREL
name: "#22f54cDrawer"
lore:
- "&8&oStore items here"
- ""
- "#e3e3e3Content&8: #baffffx%zdrawer_amount_formatted_0% %zdrawer_content_0%"
- "#e3e3e3Upgrade&8: #baffff%zdrawer_upgrade%"

Multi-Slot Drawer Lore

# For a QUAD drawer
item:
lore:
- "&8First slot:"
- " #e3e3e3x%zdrawer_amount_formatted_0% %zdrawer_content_0%"
- "&8Second slot:"
- " #e3e3e3x%zdrawer_amount_formatted_1% %zdrawer_content_1%"
- "&8Third slot:"
- " #e3e3e3x%zdrawer_amount_formatted_2% %zdrawer_content_2%"
- "&8Fourth slot:"
- " #e3e3e3x%zdrawer_amount_formatted_3% %zdrawer_content_3%"

PlaceholderAPI Integration

When PlaceholderAPI is installed, these placeholders are available for the drawer the player is currently interacting with:

PlaceholderDescription
%zdrawer_content_<index>%Item name in slot
%zdrawer_amount_<index>%Amount in slot
%zdrawer_amount_formatted_<index>%Formatted amount
%zdrawer_upgrade%Upgrade name

Usage Examples

In a scoreboard plugin:

lines:
- "&6Drawer Contents"
- "&7Slot 1: %zdrawer_content_0%"
- "&7Amount: %zdrawer_amount_formatted_0%"

In a hologram:

lines:
- "&eDrawer Info"
- "&7%zdrawer_content_0%"
- "&7x%zdrawer_amount_formatted_0%"

Default Values

When a drawer slot is empty or no upgrade is applied:

PlaceholderDefault Value
%zdrawer_content_<index>%Empty
%zdrawer_amount_<index>%0
%zdrawer_upgrade%X (or custom icon)

Configure the empty upgrade display in messages:

# In messages
EMPTY_DRAWER: "Empty"
EMPTY_UPGRADE: "#e32f1b✘"

Number Formatting

The %zdrawer_amount_formatted_<index>% placeholder uses the number format configuration:

numberFormat:
enable: true
formats:
- format: ""
maxAmount: 1000
- format: "%.1fK"
maxAmount: 1000000
- format: "%.1fM"
maxAmount: 1000000000
AmountFormatted
500500
15001.5K
25000002.5M
12345678901.2B

Testing Placeholders

Test PlaceholderAPI placeholders:

/papi parse me %zdrawer_content_0%
/papi parse me %zdrawer_amount_formatted_0%
remarque

PlaceholderAPI placeholders only work when a player has recently interacted with a drawer.

Copyright © 2026 GroupeZ|Build #loading...|-