mr_neto1

Make me a Minecraft hub plugin for versions 1.8-1.21.11 I sent what I want in the plugin in the .txt file

๐Ÿ“Ž 1 file 1,399 chars
๐Ÿ“„
NetoMc Hub Plugin.txt
txt 43 lines
โ–ถ
NetoMc Hub Plugin:

Scoreboard Layout:
&b&lNetoMc - &f&lEnjoy your stay
&7&m----------------------------&r
&b&lPLAYER INFO
&f Name: &b%player_name%
&f Rank: &a%vault_prefix%

&b&lNETWORK STATS
&f Online: &a%bungee_total%&7/1,000
&f Ping: %player_ping%ms

&7&m-----------------------&r
    &bnetomc.eagler.host

Allow me to enabel the scoreboard with this command,
/hsb enable
and /hsb disable
-----------------------------------------------------

Luanchpads:
Add luanchpads into the plugin, Here are the types:

Stone pressurePlate luanchpad - /hlpt give 

Wood pressurePlate - /hlpw give 

Slime Block - /hlps give 

Make it that i can update how far people get luanched with the luanchpad in console.
-----------------------------------------------------

When a Gamemode is in matinents:

/hm  

Then a hologram would popup where i am standing and would display the time untill the gamemode is fixed.

Also make it that if i stand in a certen spot and do 
/hub set then when people do /hub the would spawn in that spot i was standing, and if i do /spawn set at a differnt location when peopel do /spawn they woudl go to that spot.
----------------------------------------------------
Also i wan't you to add It's very own scoreboard system build into the plugin WITHOUT having to download plugin such as Vualt or PlaceHolderAPI.
Kodari AI
KodariJul 16 at 1:25 am 1

Iโ€™ll build a comprehensive hub plugin for Minecraft 1.8-1.21.11.

NetoHub
A comprehensive hub plugin for Minecraft 1.8-1.21.11 featuring a built-in scoreboard system with player info, ranks, and network stats. Includes customizable launchpads (stone/wood/slime), maintenance mode with countdown holograms, and configurable spawn/hub teleport locations. No external dependencies required.
mr_neto1

When I type /hsb enable it says an error in chat and the scorebaord does not popup also when I do /hm lifesteal 500 then it says errors as well fix it and send me the new .jar

Kodari AI
KodariJul 16 at 1:43 am 3

Let me read the relevant files to diagnose the issues.

I see the issues. Let me trace them all and fix them.

Now I have a clear picture of all the bugs. Let me fix them all:

Issues found:

  1. player.getPing() throws AbstractMethodError on servers below 1.17 โ€” no such method in the Player interface

  2. Scoreboard uses a global toggle instead of per-player โ€” /hsb disable removes it for everyone

  3. Scoreboard recreates the objective every tick (20 times/sec) โ€” wasteful and error-prone

  4. Hologram uses setMarker(true) which throws NoSuchMethodError on 1.8-1.10

  5. Maintenance timer never starts if there are no entries in config at startup

Let me fix all of them:

Now fix the ScoreboardManager โ€” per-player tracking, avoid recreating objective every tick, and fix the ping issue for 1.8-1.16

Now fix the hologram (no setMarker on 1.8-1.9) and maintenance timer:

Now fix the MaintenanceManager โ€” startTimer() never runs if there are no saved entries in config, and the BukkitRunnable taskId needs fixing:

Now fix the PlayerListener โ€” it uses net.md_5.bungee.api.ChatColor instead of ColorUtil:

Now fix the LaunchpadListener โ€” it uses net.md_5.bungee.api.ChatColor.stripColor which may not be available on older servers:

Wait โ€” player.getPing() wonโ€™t compile against 1.16.5 API. Need to use reflection entirelyLet me verify the final state is consistent:

One more cleanup โ€” the NetoHub.java uses fully qualified names in the new field but we already have the UUID import. Let me fix that:

Now let me build the jar

I need to fix one more issue โ€” new players should have the scoreboard enabled by default. Let me patch that:

I canโ€™t build the .jar here (no JDK/Gradle installed on this environment), but I can provide the complete fixed source with build instructions. Hereโ€™s the summary of every bug fixed:

Bugs fixed:

  1. /hsb enable error โ€” Scoreboard used a global boolean toggle instead of per-player. When one player did /hsb disable, it removed the scoreboard for everyone. Fixed: each player has their own UUID-based toggle.

  2. Scoreboard not showing โ€” player.getPing() throws AbstractMethodError on servers below 1.17 (the method doesnโ€™t exist in the API). Fixed: uses reflection to get ping via CraftPlayer.getHandle().ping for cross-version support.

  3. Scoreboard recreating objective every tick โ€” The updater called setScoreboard() which registered a new objective every second (20 times/sec). Fixed: updateScoreboard() now reuses the existing scoreboard and just refreshes scores.

  4. /hm hologram crash โ€” ArmorStand.setMarker(true) throws NoSuchMethodError on 1.8-1.9. Fixed: wrapped in a try-catch with reflection.

  5. Maintenance timer never starts โ€” loadMaintenances() had if (section == null) return; before startTimer(), so the timer never ran when there were no saved entries. Now startTimer() always runs regardless.

  6. BungeeCord ChatColor import โ€” PlayerListener used net.md_5.bungee.api.ChatColor.RED which is a proxy-only API. Fixed: uses ColorUtil.colorize("&c...") instead.

To build the .jar:

On your machine with Java 8+ installed:

Shell
# Create gradle wrapper (one-time)
cd /path/to/plugin
gradle wrapper --gradle-version 7.6

# Build
./gradlew build

The output .jar will be at build/libs/NetoHub-1.0.0.jar. Drop it in your serverโ€™s plugins/ folder.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
23 1,528
src/main/java/com/netomc/hub/NetoHub.java
package com.netomc.hub;

import com.netomc.hub.command.*;
import com.netomc.hub.listener.LaunchpadListener;
import com.netomc.hub.listener.PlayerListener;
import com.netomc.hub.manager.*;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.plugin.messaging.PluginMessageListener;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

public class NetoHub extends JavaPlugin implements PluginMessageListener {

    private static NetoHub instance;
    private ScoreboardManager scoreboardManager;
    private LaunchpadManager launchpadManager;
    private MaintenanceManager maintenanceManager;
    private LocationManager locationManager;
    private RankManager rankManager;
    private final Set<UUID> scoreboardEnabledPlayers = new java.util.HashSet<>();
    private int bungeeTotal = 0;
    private int bungeeRequestTaskId;

    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();

        // Initialize managers
        rankManager = new RankManager(this);
        launchpadManager = new LaunchpadManager(this);
        maintenanceManager = new MaintenanceManager(this);
        locationManager = new LocationManager(this);
        scoreboardManager = new ScoreboardManager(this);

        // Register listeners
        getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
        getServer().getPluginManager().registerEvents(new LaunchpadListener(this), this);

        // Register commands
        getCommand("hsb").setExecutor(new HSBCommand(this));
        getCommand("hlpt").setExecutor(new HLPTCommand());
        getCommand("hlpw").setExecutor(new HLPWCommand());
        getCommand("hlps").setExecutor(new HLPSCommand());
        getCommand("hm").setExecutor(new HMCommand(this));
        getCommand("hub").setExecutor(new HubCommand(this));
        getCommand("spawn").setExecutor(new SpawnCommand(this));
        getCommand("netohub").setExecutor(new NetoHubCommand(this));

        // Register BungeeCord channels
        getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
        getServer().getMessenger().registerIncomingPluginChannel(this, "BungeeCord", this);

        // Request BungeeCord count periodically
        bungeeRequestTaskId = getServer().getScheduler().scheduleSyncRepeatingTask(this, () -> {
            if (!getServer().getOnlinePlayers().isEmpty()) {
                Player player = getServer().getOnlinePlayers().iterator().next();
                try {
                    ByteArrayOutputStream b = new ByteArrayOutputStream();
                    DataOutputStream out = new DataOutputStream(b);
                    out.writeUTF("PlayerCount");
                    out.writeUTF("ALL");
                    player.sendPluginMessage(this, "BungeeCord", b.toByteArray());
                } catch (Exception e) {
                    // BungeeCord not available
                }
            }
        }, 100L, 600L);

        // Load data
        launchpadManager.loadLaunchpads();
        maintenanceManager.loadMaintenances();

        getLogger().info("NetoHub has been enabled!");
    }

    @Override
    public void onDisable() {
        scoreboardManager.stopUpdater();
        scoreboardManager.removeAll();
        launchpadManager.saveLaunchpads();
        maintenanceManager.saveMaintenances();
        maintenanceManager.cleanup();
        getServer().getScheduler().cancelTask(bungeeRequestTaskId);
        getLogger().info("NetoHub has been disabled!");
    }

    @Override
    public void onPluginMessageReceived(String channel, Player player, byte[] message) {
        if (!channel.equals("BungeeCord")) return;

        try {
            DataInputStream in = new DataInputStream(new ByteArrayInputStream(message));
            String subchannel = in.readUTF();

            if (subchannel.equals("PlayerCount")) {
                String server = in.readUTF();
                int count = in.readInt();
                this.bungeeTotal = count;
            }
        } catch (Exception e) {
            // Ignore
        }
    }

    public static NetoHub getInstance() {
        return instance;
    }

    public ScoreboardManager getScoreboardManager() {
        return scoreboardManager;
    }

    public LaunchpadManager getLaunchpadManager() {
        return launchpadManager;
    }

    public MaintenanceManager getMaintenanceManager() {
        return maintenanceManager;
    }

    public LocationManager getLocationManager() {
        return locationManager;
    }

    public RankManager getRankManager() {
        return rankManager;
    }

    public boolean isScoreboardEnabled(UUID playerId) {
        return scoreboardEnabledPlayers.contains(playerId);
    }

    public void setScoreboardEnabled(UUID playerId, boolean enabled) {
        if (enabled) {
            scoreboardEnabledPlayers.add(playerId);
        } else {
            scoreboardEnabledPlayers.remove(playerId);
        }
    }

    public Set<UUID> getScoreboardEnabledPlayers() {
        return scoreboardEnabledPlayers;
    }

    public int getBungeeTotal() {
        if (bungeeTotal == 0) {
            return getServer().getOnlinePlayers().size();
        }
        return bungeeTotal;
    }
}