coldflux

a /killshop command players kill other players specific kills gains you specific items mace being the best and add a op command called /killshop additem and when you enter it opens a gui and it opens a like chest UI you put an item and then in the lower layer a red concrete on the left side and a lime concrete on the right side clicking the red concrete kicks you out the gui and the lime concrete when pressed a sign ui appears saying Set the kill price and then when you type it and press esc button it sets it and returns to the ui but now it says a menu saying Are you sure you want to add this item to the shop. if you click the left red concrete kick but if lime it continues and its added on the shop for everyone to buy and in the /killshop a gui appears with slots for diffrent weapons that the admin put and each kill is counted by the plugin for each player and shows in the gui in the lowest layer in the ui a block in the middle saying Kills : and types a number of kills that the player has and buys it once its bought it goes in the player's inventory and a command called /pay for kills here is the syntax /pay Username amount of kills and it transfers to him he can use it in the shop and make when a player dies a lightning hits where they died and a block.amethyst_block.break sound appears but not for all players only the players near the person who got killed and make if players are not near whoever died the death message doesnt appear only if another player is 32 blocks away from the person who died they get the death message but more far will not get it add /killshop reload to reload the config /killshop remove and then item name like netherite_sword for example etc, to remove an item from the shop and /killshop changeprice and then pick an item from the command suggestions (which are the items in the shop) and when you press enter it will transport you to the gui where you set the price on the sign and then esc and the other ui appears for confirm and stuff to change the price of it and make sound effects and particles make it fancy also make the items changeable from config.yml or the prices stored in config.yml to change it quickly by doing it from the config

Kodari AI
KodariSep 17 at 11:35 am 3
KillShopGUI
A Minecraft Spigot plugin featuring a kill-based shop system. Players earn kills through PvP combat, tracked per player and displayed in a GUI showing available weapons and current kill count. Admins use /killshop additem to open a chest GUI where they place an item, confirm with lime concrete, set kill price via sign interface, and finalize with a confirmation menu. Items and prices persist in config.yml. /killshop remove and /killshop changeprice manage existing shop entries with command tab completion. /pay transfers kills between players. Death effects include lightning strikes and amethyst block break sounds for nearby players only, with death messages shown only to players within 32 blocks. /killshop reload refreshes configuration.
  1. Create the Gradle/Paper plugin scaffold and configurable shop data.

  2. Add kill tracking, nearby death effects/messages, and /pay.

  3. Add the player shop GUI plus admin add/change-price confirmation and sign flows.

  4. Register commands, listeners, tab completion, persistence, reload, and config defaults.

  1. Built the complete KillShop Paper plugin from scratch.

  2. Added configurable shop items and prices in config.yml, including mace, netherite sword, and diamond sword.

  3. Added /killshop GUI with:

    • Shop item slots

    • Kill balance display

    • Purchases using kill currency

    • Inventory-full and insufficient-kills checks

  4. Added admin commands:

    • /killshop additem

    • /killshop remove <item>

    • /killshop changeprice <item>

    • /killshop reload

  5. Added admin item editor GUI with:

    • Item placement

    • Red cancel button

    • Lime confirmation button

    • Sign-based price input

    • Final confirmation GUI

  6. Added kill tracking with persistent storage in data.yml.

  7. Added /pay <player> <amount> for transferring kills.

  8. Added nearby death messages, lightning effects, amethyst break sounds, particles, and kill rewards.

  9. Added tab completion for shop management commands.

  10. Added Gradle build files, plugin.yml, configurable messages, sounds, and shop data.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
19 1,008
src/main/java/com/kodari/killshop/KillShopPlugin.java
package com.kodari.killshop;

import com.kodari.killshop.command.KillShopCommand;
import com.kodari.killshop.command.PayKillsCommand;
import com.kodari.killshop.data.KillsManager;
import com.kodari.killshop.gui.GuiRegistry;
import com.kodari.killshop.gui.SignInputManager;
import com.kodari.killshop.listener.KillShopListener;
import com.kodari.killshop.shop.ShopManager;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public class KillShopPlugin extends JavaPlugin {
    private ShopManager shopManager;
    private KillsManager killsManager;
    private GuiRegistry guiRegistry;
    private SignInputManager signInputManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.killsManager = new KillsManager(this);
        this.shopManager = new ShopManager(this);
        this.guiRegistry = new GuiRegistry(this);
        this.signInputManager = new SignInputManager(this);

        KillShopCommand killShopCommand = new KillShopCommand(this);
        getCommand("killshop").setExecutor(killShopCommand);
        getCommand("killshop").setTabCompleter(killShopCommand);
        getCommand("pay").setExecutor(new PayKillsCommand(this));
        Bukkit.getPluginManager().registerEvents(new KillShopListener(this), this);
    }

    @Override
    public void onDisable() {
        if (signInputManager != null) {
            signInputManager.cleanup();
        }
        if (killsManager != null) {
            killsManager.save();
        }
        if (shopManager != null) {
            shopManager.save();
        }
    }

    public String message(String key, String... replacements) {
        String value = getConfig().getString("messages." + key, key);
        value = value.replace("%prefix%", getConfig().getString("prefix", ""));
        for (int i = 0; i + 1 < replacements.length; i += 2) {
            value = value.replace(replacements[i], replacements[i + 1]);
        }
        return ChatColor.translateAlternateColorCodes('&', value);
    }

    public void send(CommandSender sender, String key, String... replacements) {
        sender.sendMessage(message(key, replacements));
    }

    public ShopManager getShopManager() {
        return shopManager;
    }

    public KillsManager getKillsManager() {
        return killsManager;
    }

    public GuiRegistry getGuiRegistry() {
        return guiRegistry;
    }

    public SignInputManager getSignInputManager() {
        return signInputManager;
    }
}