Skip to content
This repository was archived by the owner on May 27, 2024. It is now read-only.

Integrations | Placeholder API

Gregory Mitchell edited this page Aug 16, 2023 · 3 revisions

Novaconomy - Placeholder API

Information about Novaconomy's Placeholder API.

Placeholder Registry

All Current Placeholders are available here in the Maps provided.

Placeholders are automatically registered if the plugin detects that Placeholder API is present. All Placeholders must be appended by novaconomy in order for them to parse correctly.

Using the /papi Command

# /papi bcparse Broadcasts the Result
/papi bcparse MyPlayer1234 His business name is %novaconomy_business_name%!

# /papi parse Returns the Result
/papi parse MyPlayer1234 He has %novaconomy_business_product_count% products!

Examples

business_name

Fetches the Player's Business Name, if it exists. Will be blank if it doesn't exist.

// Player player = ...
String businessName = PlaceholderAPI.setPlaceholders(player, "%novaconomy_business_name%");

business_product_count

The number of products the player's business has. Will be blank (not 0) if the player does not have a business.

// Player player = ...
String productCountS = PlaceholderAPI.setPlaceholders(player, "%novaconomy_business_product_count%");
int productCount = Integer.parseInt(productCountS.isEmpty() ? "0" : productCountS);

last_deposit_amount

The last deposit amount this player has made to the bank. Will be 0 if no deposits yet.

// Player player = ...
int lastDepositAmount = Integer.parseInt(PlaceholderAPI.setPlaceholders(player, "%novaconomy_last_deposit_amount%");

More Placeholder Documentation will soon follow.

Parametric Examples

v1.7.2 introduces parametric placeholders, which input additional arguments present throughout other features of the Novaconomy Plugin.

%s_balance

Fetches the balance amount for a specific economy. Since Economy names are case insensitive to create, they must be automatically lowercased.

// Player player = ...

// Fetches the balance from the 'Coins' economy
double coins = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, "%novaconomy_coins_balance%");

// Fetches the balance from the 'Gems' economy
double gems = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, "%novaconomy_gems_balance%");

// Fetches the balance from the 'Pearls' economy
double pearls = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, "%novaconomy_pearls_balance%");

%s_donated_amount

Fetches the amount of money the player has donated for this specific economy.

// Player player = ...

// Fetches the donated amount from the 'Coins' economy
double coins = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, "%novaconomy_coins_donated_amount%");

// Fetches the donated amount from the 'Gems' economy
double gems = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, "%novaconomy_gems_donated_amount%");

// Fetches the donated amount from the 'Pearls' economy
double pearls = Double.parseDouble(PlaceholderAPI.setPlaceholders(player, "%novaconomy_pearls_donated_amount%");
Clone this wiki locally