generalpioter_

write for my plugin on event npc when we click on this npc [villager] open INVENTORY GUI and we can look when events start or buy something merch for event or key for chest

Kodari AI
KodariFeb 22 at 1:14 pm 13,494 (v2)

I’ll create an Event NPC plugin with a GUI system for viewing events and purchasing items.

EventNPCPlugin
An interactive event management plugin featuring a clickable villager NPC that opens a comprehensive GUI. Players can view upcoming event schedules with detailed timings, purchase exclusive event merchandise, and buy special chest keys. Includes full economy integration, customizable items via config, and permission-based access control for different GUI sections.

Plugin created! Here’s what’s implemented:

Core Features:

  • Click on a villager NPC with the custom name “&6&lEvent Manager” to open the Event GUI

  • View upcoming events with schedules and descriptions

  • Purchase event merchandise (customizable items with enchantments)

  • Buy event keys (common, rare, legendary)

  • Full Vault economy integration

  • Permission-based access control

How to use:

  1. Spawn a villager and name it with a name tag: &6&lEvent Manager (or change in config)

  2. Right-click the villager to open the GUI

  3. Players can browse events, buy merchandise, and purchase keys

  4. Use /eventnpc reload to reload configuration

All items, prices, events, and GUI settings are fully configurable in config.yml. The plugin uses XSeries for cross-version compatibility and includes proper permission checks before purchases.

generalpioter_

delete economy i want only this INVENTORY GUI check event

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 849
src/main/java/com/eventplugin/EventNPCPlugin.java
package com.eventplugin;

import com.eventplugin.inventory.gui.GUIListener;
import com.eventplugin.inventory.gui.GUIManager;
import com.eventplugin.listener.NPCClickListener;
import com.eventplugin.manager.EconomyManager;
import com.eventplugin.manager.EventManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class EventNPCPlugin extends JavaPlugin {
    private GUIManager guiManager;
    private EventManager eventManager;
    private EconomyManager economyManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.economyManager = new EconomyManager(this);
        this.eventManager = new EventManager(this);
        this.guiManager = new GUIManager();
        
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new NPCClickListener(this), this);
        
        getLogger().info("EventNPCPlugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("EventNPCPlugin has been disabled!");
    }
    
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("eventnpc")) {
            if (!sender.hasPermission("eventnpc.admin")) {
                sender.sendMessage("§cYou don't have permission to use this command!");
                return true;
            }
            
            if (args.length > 0 && args[0].equalsIgnoreCase("reload")) {
                reloadConfig();
                eventManager.loadEvents();
                sender.sendMessage("§aEventNPCPlugin has been reloaded!");
                return true;
            }
        }
        return false;
    }
}