PerfectEconomy

Version1.0.1
PlatformHytale Server Plugin
LanguagesEN, FR, ES, DE, IT, PT
DependenciesNone

Complete server economy system with balance management, player-to-player payments, a configurable shop with categories, daily stock limits, admin UI, and a cross-plugin API with placeholders.

Installation

  1. Drop PerfectEconomy-1.0.1.jar into your server's mods/ folder
  2. Start or restart the server
  3. Config files are auto-generated on first run
  4. Customize the shop via /eco shop (admin)

Features

Commands

CommandDescriptionPermission
/balanceShow your current balanceperfecteconomy.command
/pay <player> <amount>Transfer money to another playerperfecteconomy.pay
/shopOpen the shop interfaceperfecteconomy.shop
/eco give <player> <amount>Add money to a player's balanceperfecteconomy.admin
/eco take <player> <amount>Remove money from a player's balanceperfecteconomy.admin
/eco set <player> <amount>Set exact balance for a playerperfecteconomy.admin
/eco reset <player>Reset a player's balance to starting amountperfecteconomy.admin
/eco shopOpen the shop editor (admin UI)perfecteconomy.admin.shop
/eco reloadReload all config files from diskperfecteconomy.admin
/eco setlang <code>Change plugin languageperfecteconomy.admin

Shop System

Player View

  1. Open the shop with /shop
  2. Browse categories (up to 8 displayed)
  3. View items with buy/sell prices and daily stock remaining
  4. Click to buy or sell items

The shop checks for sufficient funds, inventory space, and daily stock limits before processing transactions.

Admin Shop Editor

Access with /eco shop. Allows you to:

Default Shop

On first run, a default shop is created with 4 categories: Blocks, Ores, Tools, and Food.

API for Developers

PerfectEconomy exposes a static API that other plugins can call directly or via reflection:

// Direct import
double balance = EconomyAPI.getBalance(playerUuid);
EconomyAPI.deposit(playerUuid, 500.0);
EconomyAPI.withdraw(playerUuid, 100.0);
EconomyAPI.setBalance(playerUuid, 1000.0);
String formatted = EconomyAPI.format(1234.56); // "$1,234"
double sellPrice = EconomyAPI.getSellPrice("Iron_Ore");

// Via reflection (no compile dependency)
Class<?> api = Class.forName("fr.katsuyatv.perfecteconomy.EconomyAPI");
Method m = api.getMethod("getBalance", UUID.class);
double bal = (double) m.invoke(null, playerUuid);

Placeholders

Use EconomyAPI.resolvePlaceholders(uuid, text) to replace these:

PlaceholderOutput
{eco_balance}Raw balance (e.g., 1234.56)
{eco_balance_formatted}Formatted with symbol (e.g., $1,234)
{eco_balance_short}Short format (e.g., $1.2K, $5.3M)
{eco_currency}Currency name (e.g., Coins)
{eco_symbol}Currency symbol (e.g., $)
{eco_top_N_name}Name of Nth richest player (1-10)
{eco_top_N_balance}Balance of Nth richest player (1-10)

Configuration

economy.json

{
  "currencySymbol": "$",
  "currencyName": "Coins",
  "startingBalance": 100.0,
  "players": {}
}

shop.json

{
  "categories": [
    {
      "id": "blocks",
      "name": "Blocks",
      "icon": "Stone",
      "items": [
        {
          "itemId": "Stone",
          "buyPrice": 5.0,
          "sellPrice": 2.0,
          "dailyStock": -1,
          "enabled": true
        }
      ]
    }
  ]
}

config.json

{
  "lang": "EN"
}

All config files are stored in UserData/Saves/MODDING/mods/KatsuyaTV_PerfectEconomy/

FAQ

Can I change the currency symbol?

Yes, edit currencySymbol in economy.json and reload with /eco reload.

How do daily stock limits work?

Each item can have a daily purchase limit per player. Set to -1 for unlimited. Stock resets automatically at midnight.

How do other plugins integrate with PerfectEconomy?

Use the static EconomyAPI class. Call methods directly if you have the dependency, or use reflection for soft integration. See the API section above.

What happens if a player's inventory is full?

The purchase is rejected and the player is notified. No money is deducted.