Uno Franco Basangan

Marketplace 100 billion coins

Kodari AI
KodariOct 29 at 3:56 am 1
CoinMarketplace
Creates a player-driven marketplace where users list items for sale at custom prices in a 100 billion coin economy. Features include a central marketplace GUI, item listing with quantity and price controls, search and filter functionality, purchase confirmation dialogs, and transaction logging. Admins can manage listings, set marketplace-wide tax rates, and monitor economic activity. The plugin integrates with the server's economy system, supports multiple currencies, and includes anti-exploit measures like price caps and purchase limits. A comprehensive audit trail tracks all transactions for accountability.
  1. Create a Vault-backed item marketplace with a 100-billion-coin listing cap.

  2. Add /market browsing and /market sell <price> listing commands, plus purchase handling.

  3. Add plugin metadata and configurable messages/settings.

Created the Marketplace plugin with Vault economy support and a configurable 100 billion coin maximum listing price. Players can browse listings in a GUI, sell held items, buy listings, and cancel their own listings; listings persist across restarts.

Commands: /market, /market sell <price>, /market page <number>, /market cancel <id>. Requires Vault and an installed economy provider.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
10 600
src/main/java/com/kodari/marketplace/MarketplacePlugin.java
package com.kodari.marketplace;

import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Map;

public final class MarketplacePlugin extends JavaPlugin {

    private MarketplaceManager marketplaceManager;

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

        RegisteredServiceProvider<Economy> registration = getServer().getServicesManager().getRegistration(Economy.class);
        if (registration == null || registration.getProvider() == null) {
            getLogger().severe("No Vault economy provider was found. Marketplace is disabling.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        marketplaceManager = new MarketplaceManager(this, registration.getProvider());
        marketplaceManager.loadListings();
        getServer().getPluginManager().registerEvents(new MarketplaceListener(marketplaceManager), this);

        PluginCommand marketCommand = getCommand("market");
        if (marketCommand == null) {
            getLogger().severe("The /market command is missing from plugin.yml.");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        MarketCommand executor = new MarketCommand(this, marketplaceManager);
        marketCommand.setExecutor(executor);
    }

    public void sendMessage(CommandSender sender, String key) {
        sendMessage(sender, key, Map.of());
    }

    public void sendMessage(CommandSender sender, String key, Map<String, String> replacements) {
        String prefix = getConfig().getString("messages.prefix", "&8[&6Market&8] &r");
        String message = getConfig().getString("messages." + key, "&cMissing message: " + key);
        message = message.replace("%prefix%", prefix);
        for (Map.Entry<String, String> replacement : replacements.entrySet()) {
            message = message.replace("%" + replacement.getKey() + "%", replacement.getValue());
        }
        sender.sendMessage(ChatColor.translateAlternateColorCodes('&', prefix + message));
    }
}