kai007579

Make a plugin with custom item like effect parmanent when holding in a hand like gems also has database so I. Use /customitem give <player> <item> 1 to give make the item customizable lore effect and effect level with the display name and materiname also have the message system and reload system

Kodari AI
KodariMar 11 at 5:58 pm 21,704 (v2)

I’ll create a custom item plugin with permanent effects when held, full configurability, and a database system.

CustomItemEffects
A comprehensive custom item system allowing creation of items with permanent potion effects when held in hand. Features include fully configurable items with custom names, lore, materials, and multiple potion effects with levels. Includes command system for giving items to players, SQLite database for tracking item data, complete message system, and hot-reload support. Perfect for RPG servers wanting gem-like items with持ting buffs.

I’ll create a comprehensive custom item system with effects, database, and full configurability.

Perfect! I’ve created a comprehensive custom item system with all requested features:

Features Implemented:

  • Custom items with permanent effects when held in hand (main or offhand)

  • Full configurability: display name, lore, material, effects with levels, custom model data

  • Command system: /customitem give <player> <item> <amount>, /customitem reload, /customitem list

  • SQLite database tracking item usage and player data

  • Complete message system with placeholders

  • Hot-reload support

  • Effect removal when item is dropped or switched

  • Uses XSeries for cross-version compatibility

  • Tab completion for commands

Usage:

  • Configure items in items.yml

  • Give items: /customitem give Player fire_gem 1

  • 4 example items included: fire_gem, strength_crystal, health_essence, miners_charm

  • Effects automatically apply/remove when holding/switching items

  • All messages customizable in messages.yml

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
14 998
src/main/java/com/customitems/CustomItemsPlugin.java
package com.customitems;

import com.customitems.command.CustomItemCommand;
import com.customitems.listener.ItemHoldListener;
import com.customitems.manager.ConfigManager;
import com.customitems.manager.DatabaseManager;
import com.customitems.manager.ItemManager;
import com.customitems.manager.MessageManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CustomItemsPlugin extends JavaPlugin {
    
    private ConfigManager configManager;
    private MessageManager messageManager;
    private DatabaseManager databaseManager;
    private ItemManager itemManager;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.configManager.loadConfigs();
        
        this.messageManager = new MessageManager(this);
        
        if (this.configManager.getConfig().getBoolean("database.enabled", true)) {
            this.databaseManager = new DatabaseManager(this);
            this.databaseManager.initialize();
        }
        
        this.itemManager = new ItemManager(this);
        this.itemManager.loadItems();
        
        getCommand("customitem").setExecutor(new CustomItemCommand(this));
        
        Bukkit.getPluginManager().registerEvents(new ItemHoldListener(this), this);
        
        getLogger().info("CustomItemEffects has been enabled!");
        getLogger().info("Loaded " + this.itemManager.getCustomItems().size() + " custom items.");
    }
    
    @Override
    public void onDisable() {
        if (this.databaseManager != null) {
            this.databaseManager.close();
        }
        
        Bukkit.getOnlinePlayers().forEach(player -> {
            this.itemManager.removeAllEffects(player);
        });
        
        getLogger().info("CustomItemEffects has been disabled!");
    }
    
    public void reload() {
        this.configManager.loadConfigs();
        this.messageManager.reload();
        
        Bukkit.getOnlinePlayers().forEach(player -> {
            this.itemManager.removeAllEffects(player);
        });
        
        this.itemManager.loadItems();
        
        if (this.configManager.getConfig().getBoolean("database.enabled", true)) {
            if (this.databaseManager == null) {
                this.databaseManager = new DatabaseManager(this);
                this.databaseManager.initialize();
            }
        } else if (this.databaseManager != null) {
            this.databaseManager.close();
            this.databaseManager = null;
        }
    }
}