esco.cz

do you know the plugin playerkits2? if you know what is that and what it does

Kodari AI
KodariOct 21 at 12:56 pm 1
KitLoadoutManager
KitLoadoutManager is a Minecraft plugin that lets players create, save, and equip custom gear loadouts. Players define named kits containing specific armor, weapons, and inventory items, then instantly equip them with a single command. The plugin supports kit management via intuitive commands like /kit create, /kit equip, and /kit list, with per-player kit storage and cooldown enforcement. It integrates with Spigot/Paper APIs for seamless item handling, includes configurable cooldowns, and provides admin controls to limit kit count per player. Designed for survival and PvP servers, it streamlines gear switching without requiring external dependencies.

Yes. PlayerKits2 is a Minecraft server plugin for creating and managing player kits. Admins can configure kits containing items and set options such as permissions, cooldowns, and usage limits; players can typically browse and claim kits through commands or a GUI.

Are you looking to use it on your server, or build a plugin with similar features?

esco.cz

can u make me a recreational plugin with the similar use and uis of it, but add some additional uis for costumizing its kits that when a player commands /playerkits:editkit it can arrange its kits on the kits on the playerkit plugin and once a player clicks it it sort the items in the inventory that he costomize it

Kodari AI
KodariOct 21 at 1:03 pm 1
  1. Create a standalone PlayerKits-style plugin with a kit browser and per-player kit editor.

  2. Add /editkit plus the requested /playerkits:editkit alias; save customized layouts per player.

  3. Include starter kits and editable kit definitions in the default config.

Created a standalone PlayerKits-style kit customizer with /kits, /editkit, and the /playerkits:editkit alias. Players can open a kit, rearrange its items in the editor, and save their personal layout.

Kit definitions are in config.yml; saved layouts are stored per player in player-data.yml. This creates its own kits—it does not read or modify kits managed by an installed PlayerKits2 plugin, since that integration requires its API.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
4 438
src/main/java/com/kodari/kitcustomizer/KitCustomizerPlugin.java
package com.kodari.kitcustomizer;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.HashMap;

public final class KitCustomizerPlugin extends JavaPlugin implements Listener, CommandExecutor {
    private static final int EDITABLE_SLOTS = 45;
    private static final int SAVE_SLOT = 45;
    private static final int CANCEL_SLOT = 53;

    private final Map<Inventory, String> kitMenus = new HashMap<>();
    private final Map<Inventory, EditorSession> editors = new HashMap<>();
    private YamlConfiguration playerData;
    private File playerDataFile;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        playerDataFile = new File(getDataFolder(), "player-data.yml");
        playerData = YamlConfiguration.loadConfiguration(playerDataFile);
        Bukkit.getPluginManager().registerEvents(this, this);
        getCommand("kits").setExecutor(this);
        getCommand("editkit").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("Only players can use this command.");
            return true;
        }

        if (command.getName().equalsIgnoreCase("kits")) {
            openKitMenu(player);
            return true;
        }

        if (!canEdit(player)) {
            player.sendMessage(color("&cYou don't have permission to customize kits."));
            return true;
        }
        if (args.length == 0) {
            openKitMenu(player);
            return true;
        }

        String kitId = findKitId(args[0]);
        if (kitId == null) {
            player.sendMessage(color("&cThat kit does not exist. Use /kits to browse kits."));
            return true;
        }
        openEditor(player, kitId);
        return true;
    }

    private boolean canEdit(Player player) {
        String permission = getConfig().getString("edit-permission", "kitcustomizer.edit");
        return permission == null || permission.isBlank() || player.hasPermission(permission);
    }

    private void openKitMenu(Player player) {
        Inventory inventory = Bukkit.createInventory(null, 54,
                color(getConfig().getString("menu-title", "&8Available Kits")));
        ConfigurationSection kits = getConfig().getConfigurationSection("kits");
        if (kits != null) {
            int slot = 0;
            for (String kitId : kits.getKeys(false)) {
                if (slot >= EDITABLE_SLOTS) {
                    break;
                }
                ConfigurationSection kit = kits.getConfigurationSection(kitId);
                if (kit == null) {
                    continue;
                }
                String name = kit.getString("name", kitId);
                ItemStack icon = createItem(kit.getString("icon", "CHEST"), 1);
                if (icon == null) {
                    icon = createItem("CHEST", 1);
                }
                if (icon != null) {
                    ItemMeta meta = icon.getItemMeta();
                    if (meta != null) {
                        meta.setDisplayName(color(name));
                        List<String> lore = new ArrayList<>();
                        lore.add(color("&7Click to customize this kit"));
                        meta.setLore(lore);
                        icon.setItemMeta(meta);
                    }
                    inventory.setItem(slot, icon);
                    slot++;
                }
            }
        }
        kitMenus.put(inventory, "menu");
        player.openInventory(inventory);
    }

    private void openEditor(Player player, String kitId) {
        if (player.getItemOnCursor() != null) {
            player.sendMessage(color("&cClear your cursor before opening the kit editor."));
            return;
        }
        ConfigurationSection kit = getConfig().getConfigurationSection("kits." + kitId);
        if (kit == null) {
            player.sendMessage(color("&cThat kit does not exist."));
            return;
        }

        String title = getConfig().getString("editor-title", "&8Edit Kit: &f%kit%");
        Inventory inventory = Bukkit.createInventory(null, 54,
                color(title.replace("%kit%", ChatColor.stripColor(color(kit.getString("name", kitId))))));
        String savedPath = playerPath(player.getUniqueId(), kitId);
        ConfigurationSection saved = playerData.getConfigurationSection(savedPath);
        if (saved != null) {
            for (String key : saved.getKeys(false)) {
                try {
                    int slot = Integer.parseInt(key);
                    if (slot >= 0 && slot < EDITABLE_SLOTS) {
                        inventory.setItem(slot, saved.getItemStack(key));
                    }
                } catch (NumberFormatException ignored) {
                }
            }
        } else {
            ConfigurationSection items = kit.getConfigurationSection("items");
            if (items != null) {
                for (String key : items.getKeys(false)) {
                    try {
                        int slot = Integer.parseInt(key);
                        if (slot >= 0 && slot < EDITABLE_SLOTS) {
                            ConfigurationSection itemSection = items.getConfigurationSection(key);
                            if (itemSection != null) {
                                inventory.setItem(slot, createConfiguredItem(itemSection));
                            }
                        }
                    } catch (NumberFormatException ignored) {
                    }
                }
            }
        }

        inventory.setItem(SAVE_SLOT, button("EMERALD", "&aSave layout"));
        inventory.setItem(CANCEL_SLOT, button("BARRIER", "&cCancel"));
        editors.put(inventory, new EditorSession(player.getUniqueId(), kitId));
        player.openInventory(inventory);
    }

    private ItemStack createConfiguredItem(ConfigurationSection section) {
        ItemStack item = createItem(section.getString("material", "STONE"),
                Math.max(1, section.getInt("amount", 1)));
        if (item == null) {
            return null;
        }
        ItemMeta meta = item.getItemMeta();
        if (meta != null) {
            String displayName = section.getString("display-name");
            if (displayName != null) {
                meta.setDisplayName(color(displayName));
            }
            List<String> lore = section.getStringList("lore");
            if (!lore.isEmpty()) {
                meta.setLore(lore.stream().map(KitCustomizerPlugin::color).toList());
            }
            item.setItemMeta(meta);
        }
        return item;
    }

    private ItemStack button(String materialName, String displayName) {
        ItemStack item = createItem(materialName, 1);
        if (item != null) {
            ItemMeta meta = item.getItemMeta();
            if (meta != null) {
                meta.setDisplayName(color(displayName));
                item.setItemMeta(meta);