PerfectEconomy
| Version | 1.0.1 |
|---|---|
| Platform | Hytale Server Plugin |
| Languages | EN, FR, ES, DE, IT, PT |
| Dependencies | None |
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
- Drop
PerfectEconomy-1.0.1.jarinto your server'smods/folder - Start or restart the server
- Config files are auto-generated on first run
- Customize the shop via
/eco shop(admin)
Features
- Balance system with customizable currency symbol and name
- Player-to-player payments with toast notifications
- Configurable shop with multiple categories and custom icons
- Buy and sell mechanics per item, with enable/disable toggle
- Daily stock limits per player per item (resets at midnight)
- Admin UI for managing the shop (categories, items, prices, stock)
- Starting balance configurable for new players (default: $100)
- Cross-plugin API with static methods for deposit, withdraw, balance check
- Placeholders for scoreboards and other plugins (balance, leaderboard, currency)
- 6 languages supported with runtime switching
- JSON-based storage with pretty-printed config files
Commands
| Command | Description | Permission |
|---|---|---|
/balance | Show your current balance | perfecteconomy.command |
/pay <player> <amount> | Transfer money to another player | perfecteconomy.pay |
/shop | Open the shop interface | perfecteconomy.shop |
/eco give <player> <amount> | Add money to a player's balance | perfecteconomy.admin |
/eco take <player> <amount> | Remove money from a player's balance | perfecteconomy.admin |
/eco set <player> <amount> | Set exact balance for a player | perfecteconomy.admin |
/eco reset <player> | Reset a player's balance to starting amount | perfecteconomy.admin |
/eco shop | Open the shop editor (admin UI) | perfecteconomy.admin.shop |
/eco reload | Reload all config files from disk | perfecteconomy.admin |
/eco setlang <code> | Change plugin language | perfecteconomy.admin |
Shop System
Player View
- Open the shop with
/shop - Browse categories (up to 8 displayed)
- View items with buy/sell prices and daily stock remaining
- 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:
- Create and manage categories with custom icons
- Add items with buy/sell prices
- Set daily stock limits per item (-1 for unlimited)
- Enable/disable individual items
- Save all changes with "SAVE ALL" button
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:
| Placeholder | Output |
|---|---|
{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.