nothyperboiz1

Create MerchantShops.

Features

Chest shops

NPC shops

Admin shops

Player market

Stock system

Restocking

History

Ratings

Favorite shops

Search

Teleport

INVENTORY GUI

Everything configurable.

Supports economy API.

Kodari AI
KodariAug 7 at 8:11 am 2
MerchantShops
MerchantShops is a comprehensive shop management plugin featuring chest shops, NPC shops, admin shops, and player markets. Players can create customizable shops with stock systems, automatic restocking, and transaction history tracking. The plugin includes shop ratings, favorites system, search functionality, and teleportation to shops. All interactions use an intuitive inventory GUI framework with fully configurable settings. Supports any economy API for seamless currency integration, enabling complete virtual marketplace management within Minecraft servers.
  1. Core project and configuration.

  2. Shop models, persistence, economy, and business logic.

  3. Inventory GUI, listeners, commands, and plugin registration.

  1. Created MerchantShops from scratch with Gradle, plugin metadata, permissions, Vault support, and configurable YAML files.

  2. Added chest shops, NPC shops, admin shops, and player market shops.

  3. Implemented stock limits, restocking, buying/selling, economy transactions, transaction history, ratings, favorites, search, and teleportation.

  4. Added inventory-based market and shop GUIs with configurable titles, icons, messages, and page sizes.

  5. Added /shops commands for creation, management, browsing, rating, favorites, history, teleportation, deletion, and reloads.

nothyperboiz1

Fix the error

Kodari AI
KodariAug 7 at 9:25 am 3

Fixed the null-material error in MerchantShopsCommand.

Chest validation now safely compares the canonical material using constant-first checks, preventing a NullPointerException when the targeted block material is unsupported.

nothyperboiz1

[09:49:17 ERROR]: Error occurred while enabling MerchantShops v1.0.0 (Is it up to date?)

Kodari AI
KodariAug 7 at 9:50 am 1

Please provide the complete error stack trace from the server console, especially the lines immediately after:

Plain Text
Error occurred while enabling MerchantShops v1.0.0

Include the Caused by: section and the first at com.kodari.merchantshops... line. The single line only indicates that startup failed; it does not identify the cause.

nothyperboiz1

Fix the error

Kodari AI
KodariAug 7 at 10:11 am 1

Fixed the most likely enable error: MerchantShops no longer instantiates the Vault economy provider when Vault is absent.

Changes:

  • Added a safe DisabledEconomyProvider.

  • Added a Vault presence check before loading VaultEconomyProvider.

  • The plugin now enables without Vault, while transactions remain disabled with a clear warning.

Install Vault plus an economy plugin if you want shop transactions enabled.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
21 1,404
src/main/java/com/kodari/merchantshops/MerchantShops.java
package com.kodari.merchantshops;

import com.kodari.merchantshops.command.MerchantShopsCommand;
import com.kodari.merchantshops.economy.DisabledEconomyProvider;
import com.kodari.merchantshops.economy.EconomyProvider;
import com.kodari.merchantshops.economy.VaultEconomyProvider;
import com.kodari.merchantshops.gui.GuiManager;
import com.kodari.merchantshops.listener.ShopListener;
import com.kodari.merchantshops.service.ShopService;
import com.kodari.merchantshops.storage.ShopStorage;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class MerchantShops extends JavaPlugin {
    private ShopService shopService;
    private GuiManager guiManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        ShopStorage storage = new ShopStorage(this);
        EconomyProvider economy;
        if (Bukkit.getPluginManager().getPlugin("Vault") != null) {
            economy = new VaultEconomyProvider(this);
        } else {
            economy = new DisabledEconomyProvider();
            getLogger().warning("Vault was not found. Shop transactions are disabled.");
        }
        shopService = new ShopService(this, storage, economy);
        shopService.load();

        guiManager = new GuiManager(this, shopService);
        Bukkit.getPluginManager().registerEvents(new ShopListener(this, shopService, guiManager), this);

        MerchantShopsCommand command = new MerchantShopsCommand(this, shopService, guiManager);
        getCommand("merchantshops").setExecutor(command);
        getCommand("merchantshops").setTabCompleter(command);

        long period = Math.max(20L, getConfig().getLong("settings.restock-period-seconds", 300L) * 20L);
        Bukkit.getScheduler().runTaskTimer(this, () -> shopService.restock(), period, period);
    }

    @Override
    public void onDisable() {
        if (shopService != null) {
            shopService.save();
        }
    }

    public ShopService getShopService() {
        return shopService;
    }

    public GuiManager getGuiManager() {
        return guiManager;
    }
}