iamerror9624

please kindly follow the given prompt

📎 1 file 5,327 chars
📄
pasted-code-1795168924544.txt
txt 49 lines
▶
Plugin Overview & Architecture:
Build a complete, lightweight, and fully configurable Hub management plugin for my Minecraft server. Organize the project cleanly into packages (commands, listeners, gui, managers, utils) and provide all Java classes, plugin.yml, and default YAML configuration files (config.yml, messages.yml, selector.yml). Do not build an in-game GUI editor—keep all GUI customization cleanly driven by selector.yml.

1. Core Multi-World (Multiverse) & Config System:
* Multiverse Isolation: Include an enabled-worlds list in config.yml. All hub items, double-jumps, launchpads, scoreboards, tablists, and world protections must ONLY apply when a player is inside one of these listed worlds. When a player teleports to a Survival, Skyblock, or Minigame world via Multiverse, automatically remove the hub hotbar items and disable hub restrictions/scoreboards.
* Full Configurability: Every message, prefix, sound, particle, cooldown, item slot, material, display name, lore, and feature toggle must be editable in config.yml and messages.yml. Support both legacy color codes (&a, &l) and Hex color codes (&#RRGGBB).
* Admin Reload: Add /hub reload (alias: /lobby reload) with permission hub.admin to reload all configuration files, GUIs, and scoreboards live without restarting the server.

2. Hub Spawn Commands & Aliases:
* Set Spawn: /sethub (aliases: /setlobby, /hub setspawn, /lobby setspawn) — Permission: hub.setspawn. Saves the exact world name, X, Y, Z coordinates, Yaw, and Pitch to config.yml.
* Teleport to Hub: /hub (aliases: /lobby, /spawn) — Permission: hub.spawn. Teleports the player to the saved hub location with a configurable sound and particle effect.
* Auto-Teleport Rules:
  * Option in config.yml to teleport players to the hub spawn automatically on server join.
  * Void Teleport: If a player falls below a configurable Y-level (e.g., Y < 0) in a hub world, automatically teleport them back to the hub spawn.

3. Configurable Server Selector GUI (selector.yml):
* Opening the GUI: Players can open the Server Selector via /selector (aliases: /servers, /gamemodes) or by right-clicking the designated Server Selector item in their hotbar.
* Editable via selector.yml: Make the entire GUI easily editable in selector.yml with clear comments, supporting:
  * Custom GUI title (with color/hex support) and inventory size (9, 18, 27, 36, 45, or 54).
  * Optional filler/border items (e.g., stained glass panes in empty slots).
  * Individual items with custom slot, material, custom model data (optional), enchantment glow toggle, display name, multi-line lore, and a list of click actions.
  * Click Actions: Support action prefixes such as [PLAYER]  (without leading slash), [CONSOLE] , [MESSAGE] , [SOUND] , and [CLOSE].
  * Reloading /hub reload must immediately apply changes made to selector.yml.

4. Hotbar Items & Player Visibility Toggle:
* Automatically give configured hotbar items (slots 0-8) when a player joins or enters an enabled-world, and clear them when they leave the hub world.
* Prevent players from moving, dropping, or placing hub hotbar items unless they have hub.bypass.items or are in Creative mode.
* Player Hider Item: A dedicated hotbar toggle item with a configurable cooldown (e.g., 3 seconds) to prevent spam:
  * State 1 (Players Visible): Uses configurable item (e.g., LIME_DYE, name &aPlayers: Visible). Clicking hides all other players in the hub world.
  * State 2 (Players Hidden): Swaps item to configurable hidden state (e.g., GRAY_DYE, name &7Players: Hidden). Clicking reveals all players again.

5. Scoreboard & Tablist Manager:
* Flicker-Free Sidebar Scoreboard: Configurable title and up to 15 lines in config.yml, updated on a configurable tick interval (e.g., every 20 ticks).
* Custom Tablist: Configurable multi-line Header and Footer in config.yml, plus optional custom player list name formatting (prefix/suffix).
* Placeholders: Built-in placeholders (%player%, %online%, %max_online%, %world%, %ping%) plus automatic soft-depend hook into PlaceholderAPI if installed on the server.

6. Hub Movement & Join Effects:
* Double Jump: Toggleable for players with hub.doublejump. Configurable forward launch velocity, vertical height, sound, particle effect, and cooldown. Must safely restore flight if the player is in Creative/Spectator mode.
* Launchpads: Configurable base block + pressure plate combination (e.g., REDSTONE_BLOCK underneath STONE_PRESSURE_PLATE) that launches players forward/upward with sound and particle effects.
* Join Experience: Configurable custom join/quit messages (with an option to completely disable them), private MOTD lines sent to the joining player, Join Title & Subtitle, Actionbar message, and Join Sound.

7. World & Player Protections (Hub Worlds Only):
* Individually toggleable in config.yml (bypassed with hub.bypass.protection or Creative mode):
  * Prevent block breaking, block placing, and physical crop/farmland trampling.
  * Cancel all player damage (PvP, fall damage, fire, suffocation, drowning).
  * Disable hunger loss (keep food bar full at 20).
  * Prevent dropping or picking up items.
  * Lock weather to clear and optionally lock world time (e.g., noon).
  * Cancel natural mob spawning in hub worlds.
Kodari AI
KodariFri at 10:05 am 9
HubManager
A comprehensive hub management plugin with multi-world Multiverse integration, configurable server selector GUI, hotbar items with player visibility toggle, flicker-free scoreboard and tablist, double jump mechanics, launchpads, join effects, and world protections. Features full YAML configuration with hex color support, reload command, and PlaceholderAPI integration.

I’ll build the hub features around world-scoped state, with the selector and player-facing settings driven by YAML.

Built the hub plugin with world-scoped protections and features, a configurable selector, spawn commands, movement effects, scoreboard, tablist, and live reload.

Configure enabled-worlds in config.yml, then use /sethub to save the spawn. Selector commands are examples and may need changing for your server setup.

iamerror9624

every time when player joins, gets teleported to hub. add EnderBow which teleport the player to the location where arrow reaches. Server selector or player hider don't work when player is looking at air or nothing. also, rename plugin to GonsHUB. also add a admin panel or admin menu containing admin use and admin troll(abuse)

Kodari AI
KodariFri at 10:58 am 6
  1. Make join teleport and hub-item interactions reliable.

  2. Add the teleporting EnderBow.

  3. Rename the plugin to GonsHUB.

  4. Add an admin menu with management and troll actions.

  • Players now teleport to the saved hub spawn on join. Use /sethub first.

  • Fixed selector and player-hider interactions when clicking air.

  • Added an EnderBow to hotbar slot 4; right-click to shoot and teleport where the arrow lands.

  • Renamed the plugin to GonsHUB.

  • Added /hub admin for hub management and player-targeted troll actions, restricted to hub.admin.

Upgrade note: The rename changes the plugin’s data folder. Move your existing KodariHub configuration files into the new GonsHUB folder to retain your settings and spawn.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
12 1,066
src/main/java/com/kodari/hub/HubPlugin.java
package com.kodari.hub;

import com.kodari.hub.commands.HubCommands;
import com.kodari.hub.gui.Selector;
import com.kodari.hub.gui.AdminMenu;
import com.kodari.hub.listeners.HubListener;
import com.kodari.hub.managers.HubManager;
import com.kodari.hub.utils.Text;
import java.io.File;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public class HubPlugin extends JavaPlugin {
    private YamlConfiguration messages;
    private YamlConfiguration selectorConfig;
    private HubManager manager;
    private Selector selector;
    private AdminMenu adminMenu;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        saveResource("selector.yml", false);
        loadFiles();
        manager = new HubManager(this);
        selector = new Selector(this);
        adminMenu = new AdminMenu(this);
        HubCommands commands = new HubCommands(this);
        getCommand("hub").setExecutor(commands);
        getCommand("sethub").setExecutor(commands);
        getCommand("selector").setExecutor(commands);
        getServer().getPluginManager().registerEvents(new HubListener(this), this);
        getServer().getPluginManager().registerEvents(selector, this);
        getServer().getPluginManager().registerEvents(adminMenu, this);
        manager.start();
        getServer().getOnlinePlayers().forEach(manager::enter);
    }

    @Override
    public void onDisable() {
        if (manager != null) manager.shutdown();
    }

    private void loadFiles() {
        reloadConfig();
        messages = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml"));
        selectorConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "selector.yml"));
    }

    public void reloadHub() {
        manager.shutdown();
        loadFiles();
        manager.start();
        getServer().getOnlinePlayers().forEach(manager::enter);
        selector.refreshOpenMenus();
    }

    public HubManager manager() { return manager; }
    public Selector selector() { return selector; }
    public AdminMenu adminMenu() { return adminMenu; }
    public YamlConfiguration selectorConfig() { return selectorConfig; }

    public void message(CommandSender sender, String key) {
        String value = messages.getString(key, "");
        if (value.isEmpty()) return;
        String text = messages.getString("prefix", "") + value;
        sender.sendMessage(sender instanceof Player ? Text.format(text, (Player) sender) : Text.color(text));
    }

    public String messageText(String key, Player player) {
        return Text.format(messages.getString(key, ""), player);
    }
}