gamerz04870

Develop a custom items plugin that allows server administrators to add and manage custom item models through a user-friendly INVENTORY GUI interface. Include support for custom textures, configurable attributes (like durability and enchantments), and the ability to define crafting recipes and permissions for item usage. Ensure compatibility with popular resource packs and provide documentation for easy setup.

Kodari AI
KodariJun 28 at 4:31 pm 3

I’ll build a comprehensive custom items management plugin with GUI interface.

CustomItemsPlugin
A custom items management plugin with an inventory GUI interface for server administrators. Features include adding custom item models with custom textures via CustomModelData, configurable attributes, enchantments, crafting recipes, and permission-based usage. Compatible with popular resource packs through custom model data support. Includes a full management GUI system for viewing, editing, and distributing custom items.

Creating files in dependency order. Starting with build configuration and data models.

Building from scratch. I’ll create all files in dependency order — configs first, then models, then inventory system, then GUIs, then commands, then the main plugin.

CustomItemsPlugin
A custom items management plugin with an inventory GUI interface for server administrators. Features include adding custom item models with custom textures via CustomModelData, configurable attributes, enchantments, crafting recipes, and permission-based usage. Compatible with popular resource packs through custom model data support. Includes a full management GUI system for viewing, editing, and distributing custom items.

Now I’ll create all the GUI implementations:

Now the chat input handler, command, and main plugin class:

Now I need to create the initial items.yml and verify the InventoryGUI has correct imports. Let me also check if I used XMaterial, XSkull, Profileable, XEnchantment, XItemFlag, ChatColor, Material correctly in InventoryGUI - I used short-form references without imports.

Let me re-examine what I wrote. In InventoryGUI I used XMaterial, XSkull, Profileable, XEnchantment, XItemFlag, ChatColor, Material as if they were imported. Let me create a corrected version with proper imports.

Actually, looking at my InventoryGUI more carefully, I reference these types as though they’re top-level:

  • XMaterial - need import

  • XSkull - need import

  • Profileable - need import

  • ChatColor - need import

  • Material - need import

  • XItemFlag - not used in InventoryGUI

I need to fix the InventoryGUI to have proper imports. Let me rewrite it.

Similarly, the MainMenuGUI, ItemListGUI, ItemEditorGUI, CreateItemGUI all use these types without proper imports.

Wait - in the CreateItemGUI I also used Material.BLACK_STAINED_GLASS_PANE which should use XMaterial.

Let me rewrite InventoryGUI with proper imports and fix CreateItemGUI.

Also I used Arrays.asList in some places without importing Arrays, and List without importing.

Let me fix all the GUI files with proper imports.Now creating the items data file and fixing GUI files with proper imports:

Now rewriting the GUI files with proper imports:

Now I need to check the CustomItem class — it uses XEnchantment and XItemFlag which I didn’t explicitly import in that file. Let me check.

Looking at my CustomItem.java, I used:

  • XEnchantment.matchXEnchantment(...) - not imported

  • XItemFlag.of(...) - not imported

I need to add those imports. Let me recreate the file.

Also I need to check the XEnchantment method - xench.getEnchant() is the correct method according to the docs… Actually the XSeries docs say .getEnchant() for XEnchantment. But looking at the code pattern in the docs:

Java
XEnchantment.matchXEnchantment("SHARPNESS").ifPresent(e -> meta.addEnchant(e.getEnchant(), 5, true));

So it’s getEnchant(). But wait, I also use new org.bukkit.enchantments.EnchantmentWrapper(0) for the glow enchantment which is a bit hacky. Let me use a cleaner approach.

Also I used EnchantmentWrapper without importing it in CustomItem.java. Let me fix.

Let me recreate CustomItem.java with proper imports.Now I need to fix the CustomItem.java — it references XEnchantment and XItemFlag without imports, plus uses a fully qualified name for EnchantmentWrapper that should be imported properly.

Also need to fix the ItemBuilder utility — same issue with EnchantmentWrapper:

The project is now complete. Let me verify what I’ve created:

File structure:

Plain Text
build.gradle
src/main/resources/plugin.yml
src/main/resources/config.yml
src/main/resources/items.yml
src/main/java/com/customitems/CustomItemsPlugin.java
src/main/java/com/customitems/config/ConfigManager.java
src/main/java/com/customitems/items/CustomItem.java
src/main/java/com/customitems/items/CustomItemRegistry.java
src/main/java/com/customitems/crafting/CraftingManager.java
src/main/java/com/customitems/util/ItemBuilder.java
src/main/java/com/customitems/util/ChatInputHandler.java
src/main/java/com/customitems/commands/CustomItemsCommand.java
src/main/java/com/customitems/listener/ChatListener.java
src/main/java/com/customitems/listener/ItemUseListener.java
src/main/java/com/customitems/inventory/InventoryHandler.java
src/main/java/com/customitems/inventory/InventoryButton.java
src/main/java/com/customitems/inventory/InventoryGUI.java
src/main/java/com/customitems/inventory/gui/GUIManager.java
src/main/java/com/customitems/inventory/gui/GUIListener.java
src/main/java/com/customitems/inventory/impl/MainMenuGUI.java
src/main/java/com/customitems/inventory/impl/ItemListGUI.java
src/main/java/com/customitems/inventory/impl/ItemEditorGUI.java
src/main/java/com/customitems/inventory/impl/CreateItemGUI.java

All files created. The plugin is feature-complete with:

  1. CustomItem data model with full builder pattern, serialization, and deserialization

  2. CustomItemRegistry for loading/saving items from items.yml

  3. ConfigManager for plugin config

  4. CraftingManager for registering/unregistering shaped recipes

  5. Full GUI system (InventoryGUI, InventoryButton, GUIManager, GUIListener)

  6. MainMenuGUI — browse items, create item, reload

  7. ItemListGUI — paginated list with edit/delete

  8. ItemEditorGUI — edit all properties via chat prompts

  9. CreateItemGUI — from held item or blank

  10. CustomItemsCommand — /ci with subcommands (give, list, create, edit, reload)

  11. ChatInputHandler — async chat-based input for GUI item editing

  12. ItemUseListener — permission checks on item use

  13. ChatListener — intercepts chat for input capture

  14. ItemBuilder utility for building ItemStacks fluently

  15. XSeries for cross-version compatibility

  16. Lombok for clean data classesAll 23 files created. Here’s the complete project structure:

Plain Text
CustomItemsPlugin/
├── build.gradle
├── src/main/resources/
│   ├── plugin.yml
│   ├── config.yml
│   └── items.yml
├── src/main/java/com/customitems/
│   ├── CustomItemsPlugin.java
│   ├── config/ConfigManager.java
│   ├── items/
│   │   ├── CustomItem.java            # Data model with builder + serialization
│   │   └── CustomItemRegistry.java     # Load/save items.yml
│   ├── crafting/
│   │   └── CraftingManager.java        # Bukkit shaped recipe registration
│   ├── util/
│   │   ├── ItemBuilder.java            # Fluent ItemStack builder
│   │   └── ChatInputHandler.java       # Async chat prompt system
│   ├── commands/
│   │   └── CustomItemsCommand.java     # /ci give, list, create, edit, reload
│   ├── listener/
│   │   ├── ChatListener.java           # Captures chat for GUI inputs
│   │   └── ItemUseListener.java        # Permission checks on interaction
│   └── inventory/
│       ├── InventoryHandler.java       # Interface
│       ├── InventoryButton.java        # Builder for clickable buttons
│       ├── InventoryGUI.java           # Abstract GUI base with lazy init
│       ├── gui/
│       │   ├── GUIManager.java         # Tracks active inventories
│       │   └── GUIListener.java        # Event listener
│       └── impl/
│           ├── MainMenuGUI.java        # Browse / Create / Reload
│           ├── ItemListGUI.java        # Paginated list, edit/delete
│           ├── ItemEditorGUI.java      # Full property editor via chat
│           └── CreateItemGUI.java      # From hand or blank

Key features:

  • GUI management — /ci opens the main menu. Browse all items with pagination, left-click to edit, right-click to delete.

  • Item properties — display name, material (any XMaterial), CustomModelData for resource packs, lore, enchantments, unbreakable, glow, stack amount, permission node

  • Crafting recipes — define 3×3 shaped recipes with ingredient mapping, auto-registered with Bukkit

  • Give command — /ci give <id> [player] [amount]

  • Chat-based editing — click any property in the editor GUI, type the new value in chat

  • Auto-save — changes persist to items.yml immediately (configurable)

  • Permission system — customitems.admin for management, per-item permissions for usage

  • Resource pack ready — all items support CustomModelData for custom textures

  • Cross-version — XSeries handles material/enchantment/flag compatibility across Minecraft versions

gamerz04870

The compilation failed with this error:

code
Compilation failed with 2 error(s):

ERROR in src/main/java/com/customitems/items/CustomItem.java at line 72: cannot find symbol
            meta.addEnchant(Enchantment.LUCK, 1, true);
                                       ^
  symbol: variable LUCK
  location: class Enchantment

ERROR in src/main/java/com/customitems/util/ItemBuilder.java at line 84: cannot find symbol
            meta.addEnchant(Enchantment.LUCK, 1, true);
                                       ^
  symbol: variable LUCK
  location: class Enchantment


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/customitems/items/CustomItem.java
  - src/main/java/com/customitems/util/ItemBuilder.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJun 28 at 4:32 pm 1

Enchantment.LUCK doesn’t exist on modern Spigot. Need to use XEnchantment for the glow enchantment too

Fixed both files. Enchantment.LUCK is a legacy Spigot constant that doesn’t exist in modern Paper/Spigot builds — replaced with XEnchantment.matchXEnchantment("LUCK") from XSeries, which resolves the correct enchantment across all Minecraft versions.

gamerz04870

Make a plugin that can can chance to be a avenger and give us the power which carecter we choose and also give us the suit of the super hero that are choosen by us

Kodari AI
KodariJun 29 at 4:24 am 1
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
23 2,123
src/main/java/com/customitems/CustomItemsPlugin.java
package com.customitems;

import com.customitems.commands.CustomItemsCommand;
import com.customitems.config.ConfigManager;
import com.customitems.crafting.CraftingManager;
import com.customitems.inventory.gui.GUIListener;
import com.customitems.inventory.gui.GUIManager;
import com.customitems.items.CustomItemRegistry;
import com.customitems.listener.ChatListener;
import com.customitems.listener.ItemUseListener;
import com.customitems.util.ChatInputHandler;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class CustomItemsPlugin extends JavaPlugin {
    private GUIManager guiManager;
    private CustomItemRegistry itemRegistry;
    private ConfigManager configManager;
    private ChatInputHandler chatInputHandler;
    private CraftingManager craftingManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.configManager.load();

        this.itemRegistry = new CustomItemRegistry(this);
        this.itemRegistry.load();

        this.guiManager = new GUIManager();
        this.chatInputHandler = new ChatInputHandler();
        this.craftingManager = new CraftingManager(this, itemRegistry);

        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new ChatListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ItemUseListener(this), this);

        getCommand("customitems").setExecutor(new CustomItemsCommand(this));

        craftingManager.registerRecipes();

        getLogger().info("CustomItemsPlugin v" + getDescription().getVersion() + " enabled.");
        getLogger().info("Loaded " + itemRegistry.size() + " custom items.");
    }

    @Override
    public void onDisable() {
        if (itemRegistry != null) {
            itemRegistry.save();
        }
        if (craftingManager != null) {
            craftingManager.unregisterRecipes();
        }
        getLogger().info("CustomItemsPlugin disabled.");
    }

    public void reloadItems() {
        craftingManager.unregisterRecipes();
        itemRegistry.load();
        craftingManager.registerRecipes();
    }

    public GUIManager getGuiManager() {
        return guiManager;
    }

    public CustomItemRegistry getItemRegistry() {
        return itemRegistry;
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public ChatInputHandler getChatInputHandler() {
        return chatInputHandler;
    }

    public CraftingManager getCraftingManager() {
        return craftingManager;
    }
}