picklecord

Create me a minecraft plugin for 26.2 for hubs. It has the ability to get a server selector when in the hub world, auto creates hub world(or you can set it with spawn point) the server selector is optional, with the likes of hypixels player hider etc in the hub. Plus amazing hub features.

Kodari AI
KodariAug 9 at 6:12 pm 2
HubMaster
HubMaster is a comprehensive hub management plugin that automatically creates and manages a hub world with configurable spawn points. It features an optional server selector GUI, player visibility toggling similar to popular network hubs, and a suite of hub amenities including double-jump, launch pads, and particle effects. The plugin provides a clean command system for world setup, spawn management, and feature configuration, all accessible through a user-friendly configuration file.
  1. Core plugin and build files.

  2. Configurable hub-world creation/spawn management.

  3. Optional server-selector GUI with proxy connections.

  4. Player hider, double-jump, hub protection, join/respawn handling.

Created a complete configurable hub plugin from scratch:

  • Auto-creates or uses a configured hub world.

  • Supports /hub, /hub selector, /hub hide, /hub setspawn, and /hub reload.

  • Optional server-selector GUI with BungeeCord server connections.

  • Player hider with visible/hidden states.

  • Double-jump flight system.

  • Hub protection for block breaking, placing, damage, hunger, item dropping, and interactions.

  • Void teleport back to spawn.

  • Join/respawn teleportation, welcome title, configurable items, messages, server icons, permissions, and spawn coordinates.

  • Gradle build configured for Java 21, Paper API, XSeries, and Lombok.

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

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Locale;

public final class HubPlugin extends JavaPlugin implements CommandExecutor {
    private HubConfig config;
    private HubWorldManager worldManager;
    private VisibilityManager visibility;
    private ServerSelector selector;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        config = new HubConfig(this);
        worldManager = new HubWorldManager(this, config);
        worldManager.ensureWorld();
        visibility = new VisibilityManager(this, config);
        selector = new ServerSelector(this, config);

        getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
        getServer().getPluginManager().registerEvents(
                new HubListener(this, config, worldManager, visibility, selector), this);
        if (getCommand("hub") != null) {
            getCommand("hub").setExecutor(this);
        }
        getLogger().info("KodariHub enabled with world '" + config.worldName() + "'.");
    }

    @Override
    public void onDisable() {
        getServer().getMessenger().unregisterOutgoingPluginChannel(this, "BungeeCord");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 0) {
            if (!(sender instanceof Player player)) {
                sender.sendMessage("Only players can use /hub without arguments.");
                return true;
            }
            return returnToHub(player);
        }

        String subcommand = args[0].toLowerCase(Locale.ROOT);
        if (subcommand.equals("selector")) {
            if (!(sender instanceof Player player)) {
                sender.sendMessage("Only players can open the server selector.");
                return true;
            }
            selector.open(player);
            return true;
        }
        if (subcommand.equals("hide")) {
            if (!(sender instanceof Player player)) {
                return true;
            }
            visibility.toggle(player);
            player.sendMessage(HubItems.color(visibility.isHidden(player)
                    ? config.message("hidden") : config.message("visible")));
            return true;
        }
        if (subcommand.equals("setspawn")) {
            if (!sender.hasPermission("hub.admin")) {
                sender.sendMessage(HubItems.color(config.message("no-permission")));
                return true;
            }
            if (!(sender instanceof Player player)) {
                sender.sendMessage("Only players can set the hub spawn.");
                return true;
            }
            if (!worldManager.isHubWorld(player.getWorld())) {
                sender.sendMessage(HubItems.color(config.message("no-hub-world")));
                return true;
            }
            worldManager.setSpawn(player.getLocation());
            sender.sendMessage(HubItems.color(config.message("spawn-set")));
            return true;
        }
        if (subcommand.equals("reload")) {
            if (!sender.hasPermission("hub.admin")) {
                sender.sendMessage(HubItems.color(config.message("no-permission")));
                return true;
            }
            reloadConfig();
            worldManager.ensureWorld();
            sender.sendMessage(HubItems.color("&aKodariHub configuration reloaded."));
            return true;
        }
        sender.sendMessage(HubItems.color("&e/hub &7- return to hub\n&e/hub selector &7- select a server\n&e/hub hide &7- toggle players"));
        return true;
    }

    private boolean returnToHub(Player player) {
        Location spawn = worldManager.getSpawn();
        if (spawn == null) {
            player.sendMessage(HubItems.color(config.message("no-hub-world")));
            return true;
        }
        player.teleport(spawn);
        player.sendMessage(HubItems.color(config.message("returned")));
        return true;
    }
}