A.B challenge show

i want a plugin in which 4 hotbar apper like off hand hotbar left in the offhand hotbar in which armour shows in these 4 hotbars

Kodari AI
KodariOct 17 at 4:39 pm 1
QuadHotbarArmor
QuadHotbarArmor is a Minecraft plugin that adds four additional hotbar slots to the player's interface, displayed as an offhand-style hotbar on the left side of the screen. These four slots function as dedicated armor slots, allowing players to quickly view and swap between armor pieces without opening the inventory. The plugin uses packet-based GUI manipulation to render the custom hotbar, supports configurable slot positions, and provides seamless integration with vanilla armor mechanics. Players can equip, unequip, and swap armor directly from the custom hotbar via right-click interactions. The plugin includes permission nodes for access control, a reload command for configuration updates, and full compatibility with Spigot/Paper servers.

Created the ArmorHotbar plugin. Use /armorhotbar to open a four-slot menu showing your equipped helmet, chestplate, leggings, and boots; clicking a slot equips or removes its armor.

A vanilla server plugin can’t add slots to the player’s on-screen HUD hotbar, so this uses an inventory menu instead.

A.B challenge show

make it always apeers left side of off hand hotbar

Kodari AI
KodariOct 17 at 4:42 pm 1

A server plugin can’t add custom slots to the HUD or position them beside the offhand slot—the client controls that part of the screen. The current /armorhotbar menu can’t stay open as an overlay during normal gameplay.

To get that exact layout, players would need a client-side mod. I can instead make the armor status stay visible in the action bar, above the hotbar.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
3 182
src/main/java/com/kodari/armorhotbar/ArmorHotbarPlugin.java
package com.kodari.armorhotbar;

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.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.PlayerInventory;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.List;

public final class ArmorHotbarPlugin extends JavaPlugin implements Listener, CommandExecutor {
    private static final String MENU_TITLE = ChatColor.DARK_GRAY + "Armor Hotbar";
    private static final int[] ARMOR_SLOTS = {2, 3, 4, 5};
    private static final String[] ARMOR_NAMES = {"Helmet", "Chestplate", "Leggings", "Boots"};

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("armorhotbar").setExecutor(this);
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("This command can only be used in-game.");
            return true;
        }

        openMenu(player);
        return true;
    }

    private void openMenu(Player player) {
        Inventory inventory = Bukkit.createInventory(null, 9, MENU_TITLE);
        for (int i = 0; i < ARMOR_SLOTS.length; i++) {
            ItemStack armor = getArmor(player.getInventory(), i);
            inventory.setItem(ARMOR_SLOTS[i], isEmpty(armor) ? createPlaceholder(ARMOR_NAMES[i]) : armor.clone());
        }
        player.openInventory(inventory);
    }

    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        if (!MENU_TITLE.equals(event.getView().getTitle())) {
            return;
        }

        event.setCancelled(true);
        if (!(event.getWhoClicked() instanceof Player player)
                || event.getClickedInventory() != event.getView().getTopInventory()) {
            return;
        }

        int armorIndex = -1;
        for (int i = 0; i < ARMOR_SLOTS.length; i++) {
            if (event.getSlot() == ARMOR_SLOTS[i]) {
                armorIndex = i;
                break;
            }
        }
        if (armorIndex < 0) {
            return;
        }

        ItemStack cursor = event.getCursor();
        if (!isEmpty(cursor) && !isArmorForSlot(cursor, armorIndex)) {
            player.sendMessage(ChatColor.RED + "That item cannot be placed in this armor slot.");
            return;
        }

        PlayerInventory playerInventory = player.getInventory();
        ItemStack equipped = getArmor(playerInventory, armorIndex);
        setArmor(playerInventory, armorIndex, isEmpty(cursor) ? null : cursor.clone());
        event.setCursor(isEmpty(equipped) ? null : equipped.clone());
        event.getView().getTopInventory().setItem(ARMOR_SLOTS[armorIndex],
                isEmpty(cursor) ? createPlaceholder(ARMOR_NAMES[armorIndex]) : cursor.clone());
    }

    @EventHandler
    public void onInventoryDrag(InventoryDragEvent event) {
        if (MENU_TITLE.equals(event.getView().getTitle())) {
            event.setCancelled(true);
        }
    }

    private ItemStack createPlaceholder(String name) {
        ItemStack item = XMaterial.matchXMaterial("GRAY_STAINED_GLASS_PANE")
                .map(XMaterial::parseItem)
                .orElse(null);
        if (item == null) {
            return null;
        }

        ItemMeta meta = item.getItemMeta();
        if (meta != null) {
            meta.setDisplayName(ChatColor.YELLOW + name);
            meta.setLore(List.of(ChatColor.GRAY + "Click to equip or remove"));
            item.setItemMeta(meta);
        }
        return item;
    }

    private ItemStack getArmor(PlayerInventory inventory, int slot) {
        return switch (slot) {
            case 0 -> inventory.getHelmet();
            case 1 -> inventory.getChestplate();
            case 2 -> inventory.getLeggings();
            case 3 -> inventory.getBoots();
            default -> null;
        };
    }

    private void setArmor(PlayerInventory inventory, int slot, ItemStack item) {
        switch (slot) {
            case 0 -> inventory.setHelmet(item);
            case 1 -> inventory.setChestplate(item);
            case 2 -> inventory.setLeggings(item);
            case 3 -> inventory.setBoots(item);
            default -> { }
        }
    }

    private boolean isArmorForSlot(ItemStack item, int slot) {
        String type = item.getType().name();
        return switch (slot) {
            case 0 -> type.endsWith("_HELMET");
            case 1 -> type.endsWith("_CHESTPLATE") || type.equals("ELYTRA");
            case 2 -> type.endsWith("_LEGGINGS");
            case 3 -> type.endsWith("_BOOTS");
            default -> false;
        };
    }

    private boolean isEmpty(ItemStack item) {
        return item == null || item.getType().isAir();
    }
}