Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buyOn this page, you will find how to turn any PlaceholderAPI value into a currency.
A Placeholder currency lets a shop charge in anything another plugin keeps a number for, such as a DeluxeMenus meta value or a token plugin with no economy hook of its own. The balance is read from a placeholder, and the money is moved by console commands you write. This is a Premium feature and needs PlaceholderAPI.
On Lite, Placeholder currencies are not loaded and the console says so once.
Open Editor > Settings > Currencies and click New Placeholder Currency, or pick the Placeholder type on a shop, category or item and right-click it. Each new currency gets the next free id, custom_1, custom_2 and so on, with Tokens as its display name, and opens straight into its settings. Any number can be made, and each one shows up by its display name in the currency picker of a shop, category or item.
Right-clicking a placeholder currency in the currency picker of a shop, category or item opens its settings, with the Currency Format beside them. The Currency Format is how prices are written, such as %amount% Tokens.
The name shown after prices, like 50 Tokens, and in the currency picker. It cannot be empty.
The placeholder that holds a player's balance, such as %deluxemenus_meta_mynewint_INTEGER_1%. It has to return a number. Commas are ignored and k, m, b and t suffixes are read, but anything else that is not a number leaves the player unable to afford anything.
An empty or wrong placeholder is not checked: the currency stays usable while PlaceholderAPI is installed, and every player reads as having nothing.
The console command that runs when a player pays in this currency, taking the price from them. For example dm meta %player% subtract mynewint INTEGER %amount_int%.
The console command that runs when a player is paid in this currency, giving them the price. For example dm meta %player% add mynewint INTEGER %amount_int%.
| Placeholder | Description |
|---|---|
| %player% | The player's name. |
| %amount% | The price, with decimals. |
| %amount_int% | The price rounded up to a whole number. |
The plugin cannot tell whether a command worked. Test both commands on yourself before pricing a shop in the currency, since a typo takes nothing or pays nothing while the purchase or sale still goes through.
The whole currency is written into the block of the shop, category or item that uses it.
currency:
type: PLACEHOLDER
identifier: tokens
placeholder:
display-name: Tokens
balance: '%deluxemenus_meta_mynewint_INTEGER_1%'
buy: 'dm meta %player% subtract mynewint INTEGER %amount_int%'
sell: 'dm meta %player% add mynewint INTEGER %amount_int%'
When several blocks share an identifier, the first one read defines the currency. Editing it in-game rewrites every block that uses it.
Oops... looks like the spiders padded through here
Add products to your cart and remove them from here Lets buy