Mine Up

Create a Vault-backed economy plugin with /balance, /pay, and /baltop, persisted to SQLite.

Kodari AI
KodariSep 5 at 8:43 am 2
VaultEconomySuite
A Vault-backed economy plugin providing /balance, /pay, and /baltop commands with SQLite persistence. Features configurable starting balance, transaction logging, and async database operations. Implements Vault economy interface for cross-plugin compatibility, supports offline player payments, and includes a top-balance leaderboard with pagination. Data stored in SQLite with automatic table creation and backup on startup.

I’ll create the Gradle project, Vault economy provider, SQLite persistence layer, commands, configuration, and dependency manifest.

Created a Vault-backed SQLite economy plugin with:

  • /balance [player] and /bal

  • /pay <player> <amount>

  • /baltop and /balancetop

  • Atomic player-to-player transfers

  • Configurable starting balance and currency formatting

  • SQLite persistence

  • Vault economy service registration

  • Gradle build and dependency manifest

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
8 674
src/main/java/com/kodari/economy/VaultEconomyPlugin.java
package com.kodari.economy;

import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.ServicePriority;
import org.bukkit.plugin.java.JavaPlugin;

import java.sql.SQLException;

public final class VaultEconomyPlugin extends JavaPlugin {
    private DatabaseManager database;
    private EconomyService economy;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        database = new DatabaseManager(this);
        try {
            database.initialize();
        } catch (SQLException exception) {
            getLogger().severe("Could not initialize the economy database: " + exception.getMessage());
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        economy = new EconomyService(this, database);
        getServer().getServicesManager().register(Economy.class, economy, this, ServicePriority.Highest);

        EconomyCommand command = new EconomyCommand(economy);
        getCommand("balance").setExecutor(command);
        getCommand("balance").setTabCompleter(command);
        getCommand("pay").setExecutor(command);
        getCommand("pay").setTabCompleter(command);
        getCommand("baltop").setExecutor(command);
        getCommand("baltop").setTabCompleter(command);
    }

    @Override
    public void onDisable() {
        getServer().getServicesManager().unregisterAll(this);
        if (database != null) {
            database.close();
        }
    }
}