connirkb2098

Create a plugin that adds a spawner INVENTORY GUI where spawn eggs can be stacked. There should also be a pro version of this spawner INVENTORY GUI where multiple spawn eggs can be stacked (these are purchasable essentials).

Kodari AI
KodariFeb 16 at 7:25 pm 17,221 (v2)

I’ll create a spawner inventory GUI plugin with stackable spawn eggs and a pro version that supports multiple egg types.

SpawnerStackGUI
Advanced spawner inventory system allowing players to stack spawn eggs inside custom spawner GUIs. Features two spawner types: Basic spawners that hold one entity type with unlimited stacking, and Pro spawners that can hold multiple entity types simultaneously. Includes persistent storage, upgrade system, and admin management commands. Players interact with spawners through intuitive inventory interfaces.

Plugin created successfully! SpawnerStackGUI features a complete inventory GUI system with stackable spawn eggs. Basic spawners hold one entity type with unlimited stacking, while Pro spawners support up to 9 different entity types simultaneously. All spawner data persists across restarts with auto-save functionality. Use /spawner give <player> <basic|pro> to distribute spawners and right-click placed spawners to access the GUI interface.

connirkb2098

Make it so that eggs can be put in, but also taken out again.

Kodari AI
KodariFeb 16 at 7:52 pm 12,407 (v2)

I’ll read the relevant files to understand the current spawner system and how eggs are handled.

Looking at the code, I can see that the ProSpawnerGUI already allows taking eggs out (lines 80-96), but the BasicSpawnerGUI has a problem - it tries to handle removal (lines 79-87) but the interactive slots don’t actually display the eggs stored in the spawner.

I need to fix BasicSpawnerGUI to properly display eggs in the interactive slots and allow withdrawal. Let me update it:

Updated BasicSpawnerGUI to properly display stacked eggs in the interactive slots (9-17) and allow withdrawal by clicking them, matching the ProSpawnerGUI behavior where users can both deposit and withdraw eggs.

connirkb2098

es sollte dann so aussehen

1 image attached
Kodari AI
KodariFeb 16 at 8:06 pm 14,957 (v2)

Ich verstehe. Das Spawner-GUI sollte ein 3-zeiliges (27 Slots) oberes Inventar haben statt des aktuellen großen Inventars. Lass mich zuerst die relevanten Dateien prüfen.

Ich werde das GUI anpassen, um es wie im Bild darzustellen - ein 3-zeiliges Inventar mit Close-Button, Display-Item und Spawn-Ei in der Mitte.

Das BasicSpawnerGUI wurde angepasst, um dem Bild zu entsprechen: kompaktes 3-zeiliges Layout mit Close-Button (Slot 10), Remove All/Add-Button (Slot 13 Mitte) und Display-Item (Slot 16), plus dynamischer Titel mit Spawner-ID.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
17 1,222
src/main/java/com/spawnerstack/SpawnerStackGUI.java
package com.spawnerstack;

import com.spawnerstack.command.SpawnerCommand;
import com.spawnerstack.inventory.gui.GUIListener;
import com.spawnerstack.inventory.gui.GUIManager;
import com.spawnerstack.listener.SpawnerBreakListener;
import com.spawnerstack.listener.SpawnerInteractListener;
import com.spawnerstack.manager.SpawnerManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class SpawnerStackGUI extends JavaPlugin {
    
    private GUIManager guiManager;
    private SpawnerManager spawnerManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.guiManager = new GUIManager();
        this.spawnerManager = new SpawnerManager(this);
        
        registerListeners();
        registerCommands();
        
        this.spawnerManager.loadSpawners();
        
        if (getConfig().getBoolean("data.auto-save", true)) {
            int interval = getConfig().getInt("data.save-interval", 300) * 20;
            Bukkit.getScheduler().runTaskTimer(this, () -> {
                this.spawnerManager.saveSpawners();
            }, interval, interval);
        }
        
        getLogger().info("SpawnerStackGUI has been enabled!");
    }
    
    @Override
    public void onDisable() {
        this.spawnerManager.saveSpawners();
        getLogger().info("SpawnerStackGUI has been disabled!");
    }
    
    private void registerListeners() {
        GUIListener guiListener = new GUIListener(this.guiManager);
        Bukkit.getPluginManager().registerEvents(guiListener, this);
        Bukkit.getPluginManager().registerEvents(new SpawnerInteractListener(this), this);
        Bukkit.getPluginManager().registerEvents(new SpawnerBreakListener(this), this);
    }
    
    private void registerCommands() {
        getCommand("spawner").setExecutor(new SpawnerCommand(this));
    }
    
    public String getMessage(String path) {
        return ChatColor.translateAlternateColorCodes('&', 
            getConfig().getString("messages." + path, "&cMessage not found: " + path));
    }
}