📄
pasted-code-1782322307064.txt
txt
52 lines
▶
Create an advanced, multi-layered (Matryoshka style) Admin Control Panel plugin for Paper 1.21. Use Java 21 and the modern Adventure API for styling.
Features to implement:
1. Main INVENTORY GUI (54 slots) titled "Admin Master Panel" (/admin command, OP only):
- Slot 10: FEATHER (Toggle Fly mode for admin).
- Slot 12: ENCHANTED_GOLDEN_APPLE (Toggle God Mode for admin).
- Slot 14: POTION (Apply Speed 5, Strength 5, and Saturation to admin for 10 minutes).
- Slot 16: MILK_BUCKET (Clear all active potion effects from admin).
- Slot 28: GRASS_BLOCK ("World Settings") -> Opens World INVENTORY GUI.
- Slot 30: PLAYER_HEAD ("Player Settings") -> Opens Player List INVENTORY GUI.
- Slot 32: SPAWNER ("Mob Spawner Menu") -> Opens Spawner INVENTORY GUI.
- Slot 34: COMMAND_BLOCK ("Server System Settings") -> Opens Server Tech INVENTORY GUI.
- Slot 49: BARRIER ("Clear Lag") -> Instantly deletes all dropped items globally.
2. World Settings INVENTORY GUI (27 slots) titled "World Control":
- SUNFLOWER: Set weather to clear.
- WATER_BUCKET: Set weather to rain.
- LIGHTNING_ROD: Set weather to thunder storms.
- CLOCK: Set world time to Day (1000).
- BLACK_WOOL: Set world time to Night (13000).
- Slot 26: ARROW -> Returns to Main INVENTORY GUI.
3. Player Settings INVENTORY GUI (54 slots) titled "Online Players":
- Populates dynamically with player heads of all online players.
- Clicking a player's head opens a specific "Player Action INVENTORY GUI" for that exact player.
- Slot 53: ARROW -> Returns to Main INVENTORY GUI.
4. Player Action INVENTORY GUI (27 slots) titled "Manage: ":
- CHEST: Opens the player's real-time inventory (invsee) allowing full modification.
- COMPASS: Teleports admin to the player and sends player's exact X, Y, Z coordinates to admin's chat.
- PACKED_ICE: Toggles a freeze state on this player (cancels movement, jumping, and block breaking).
- DIAMOND_SWORD: Kicks the player from the server.
- Slot 26: ARROW -> Returns to Player Settings INVENTORY GUI.
5. Mob Spawner INVENTORY GUI (27 slots) titled "Entity Spawner":
- ZOMBIE_SPAWN_EGG: Spawns 5 zombies at admin's location.
- CREEPER_SPAWN_EGG: Spawns 1 creeper at admin's location.
- WITHER_SKELETON_SKULL: Spawns a Wither boss.
- NETHER_STAR ("Kill All Mobs"): Instantly kills all hostile mobs within a 100-block radius.
- Slot 26: ARROW -> Returns to Main INVENTORY GUI.
6. Server Tech INVENTORY GUI (27 slots) titled "Server Core Configuration":
- REPEATER: Cycles server difficulty (Peaceful -> Easy -> Normal -> Hard).
- WRITABLE_BOOK: Toggles Server Whitelist state on/off.
- IRON_DOOR: Toggles Global PVP state on/off in the world.
- Slot 26: ARROW -> Returns to Main INVENTORY GUI.
Requirements & Security:
- Fully compile into a single executable .jar file for the plugins folder.
- Cancel InventoryClickEvent for all custom GUIs so items cannot be taken out (except inside the invsee view).
- Ensure strict security checks so non-OP players can never trigger any actions or open menus.
I’ll create an advanced multi-layered Admin Control Panel plugin with nested inventory GUIs for comprehensive server management.
All files created! The plugin features:
6 Nested GUIs:
Main Admin Panel (54 slots) - Fly/god mode, potions, clear lag, access to sub-menus
World Settings - Weather (clear/rain/thunder) and time (day/night) control
Player List - Dynamic player heads showing all online players
Player Action - Per-player management (invsee, teleport, freeze, kick)
Mob Spawner - Entity spawning (zombies, creepers, wither) and mass kill
Server Tech - Difficulty cycling, whitelist toggle, PVP toggle
Security: All actions require OP status, all custom GUIs cancel item removal
Navigation: Every sub-GUI has an arrow button to return to its parent menu
Fix and rebuild this Paper 1.21 Admin Plugin. Use Java 21 and Adventure API.
CRITICAL FIXES NEEDED:
- Dynamic Player List: Inside the Player Settings INVENTORY GUI, you MUST dynamically populate slots with the actual PLAYER_HEAD items of all currently online players. Set each head's display name to the online player's nickname. Clicking a specific head must open the Player Action INVENTORY GUI for that exact player.
- Potion Effects Target Fix: Remove the potion button from the Main INVENTORY GUI. Instead, inside the Player Action INVENTORY GUI for a specific player, add a POTION item titled "Give Potion Effects". Clicking this item must open a secondary "Player Effects INVENTORY GUI" (27 slots) where the admin can select an effect (Speed, Slowness, Levitation, Strength, Blindness, Glow) to apply specifically to that CHOSEN player, not the admin.
FULL STRUCTURE TO RE-COMPILE:
- Main INVENTORY GUI (/admin):
- FEATHER (Toggle Fly for admin). - ENCHANTED_GOLDEN_APPLE (Toggle God Mode for admin). - BARRIER (Clear Lag). - GRASS_BLOCK ("World Settings") -> Opens World INVENTORY GUI. - PLAYER_HEAD ("Player Settings") -> Opens the FIXED Dynamic Player List INVENTORY GUI.
- World Settings INVENTORY GUI:
- SUNFLOWER (Clear weather), WATER_BUCKET (Rain), LIGHTNING_ROD (Thunder), CLOCK (Day), BLACK_WOOL (Night). ARROW to return.
- Fixed Player Settings INVENTORY GUI:
- Automatically loads SkullMeta for all online players. Clicking opens Player Action INVENTORY GUI for them. ARROW to return.
- Player Action INVENTORY GUI (For the selected player):
- CHEST (Open their invsee inventory). - COMPASS (Teleport to them + print coordinates). - PACKED_ICE (Freeze/unfreeze them specifically). - DIAMOND_SWORD (Kick them). - POTION ("Give Effects to this Player") -> Opens Player Effects INVENTORY GUI. - ARROW to return to Player List.
- Player Effects INVENTORY GUI (Applies to the selected player):
- FEATHER (Speed V for 1 minute). - SOUL_SAND (Slowness V for 1 minute). - DIAMOND_SWORD (Strength V for 1 minute). - SHULKER_SHELL (Levitation V for 30 seconds). - PHANTOM_MEMBRANE (Invisibility for 5 minutes). - ARROW to return to Player Action INVENTORY GUI.
Requirements:
- Prevent taking items out of all custom inventories (except invsee).
- Ensure all actions apply ONLY to the selected target player, and menus only open for OPs.
I’ll fix and rebuild the plugin with the dynamic player list and restructured potion effects system.
Now I’ll fix the critical issues:
Remove potion effects from Main GUI (they’ll move to per-player management)
Add potion effects button to Player Action GUI
Create new Player Effects GUI targeting the selected player
Perfect! Now let me verify the plugin compiles and summarize the complete structure:
✅ FIXED - Main Admin Panel (/admin command, OP-only):
Slot 10: FEATHER - Toggle Fly Mode for admin
Slot 12: ENCHANTED_GOLDEN_APPLE - Toggle God Mode for admin
Slot 28: GRASS_BLOCK - Opens World Settings GUI
Slot 30: PLAYER_HEAD - Opens Dynamic Player List GUI
Slot 32: SPAWNER - Opens Mob Spawner GUI
Slot 34: COMMAND_BLOCK - Opens Server Tech GUI
Slot 49: BARRIER - Clear Lag (removes all dropped items)
✅ World Settings GUI (27 slots):
SUNFLOWER, WATER_BUCKET, LIGHTNING_ROD - Weather control
CLOCK, BLACK_WOOL - Time control (day/night)
Slot 26: ARROW - Return to Main GUI
✅ FIXED - Dynamic Player List GUI (54 slots):
Automatically populates with actual player heads (using SkullMeta)
Each head shows player name, health, coordinates
Clicking any head opens Player Action GUI for that specific player
Slot 53: ARROW - Return to Main GUI
✅ FIXED - Player Action GUI (27 slots, per-player):
Slot 10: CHEST - Open target’s inventory (invsee with full editing)
Slot 12: COMPASS - Teleport to target + show coordinates
Slot 14: PACKED_ICE - Freeze/unfreeze target player
Slot 16: DIAMOND_SWORD - Kick target player
Slot 22: POTION - Opens NEW Player Effects GUI ✨
Slot 26: ARROW - Return to Player List
✅ NEW - Player Effects GUI (27 slots, applies to target):
Speed V (1 min), Slowness V (1 min), Strength V (1 min)
Levitation V (30 sec), Invisibility (5 min), Glowing (1 min), Blindness (30 sec)
All effects apply to the selected target player, not the admin
Slot 26: ARROW - Return to Player Action GUI
Mob Spawner GUI (27 slots):
Spawn zombies, creepers, wither boss
Kill all hostile mobs in 100-block radius
Slot 26: ARROW - Return to Main GUI
Server Tech GUI (27 slots):
Cycle difficulty (Peaceful → Easy → Normal → Hard)
Toggle whitelist on/off
Toggle global PVP on/off
Slot 26: ARROW - Return to Main GUI
Security: All menus require OP status, all custom GUIs prevent item removal (except invsee), full navigation system between all menus.
package com.adminpanel;
import com.adminpanel.command.AdminCommand;
import com.adminpanel.inventory.gui.GUIListener;
import com.adminpanel.inventory.gui.GUIManager;
import com.adminpanel.manager.FlyManager;
import com.adminpanel.manager.FreezeManager;
import com.adminpanel.manager.GodModeManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class AdminControlPanel extends JavaPlugin {
private GUIManager guiManager;
private FlyManager flyManager;
private GodModeManager godModeManager;
private FreezeManager freezeManager;
@Override
public void onEnable() {
guiManager = new GUIManager();
flyManager = new FlyManager();
godModeManager = new GodModeManager();
freezeManager = new FreezeManager();
Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
Bukkit.getPluginManager().registerEvents(godModeManager, this);
Bukkit.getPluginManager().registerEvents(freezeManager, this);
getCommand("admin").setExecutor(new AdminCommand(this));
getLogger().info("AdminControlPanel has been enabled!");
}
@Override
public void onDisable() {
getLogger().info("AdminControlPanel has been disabled!");
}
}