R

Make a plugin named Ip Master which supports all version of minecraft java and bedrock edition(by Geyser mc and floodgate).

In this plugin player can set their own ip address to the server via config.

In config there will be default ip address section and own ip address section. in default ip address section there the user sets the original ip address of server and in own ip address section the user will set their own ip address. The port will be the default port given by server hosting. Add a command /ip reload which reloads the full plugin and instantly implement new ip. Disable old own ip after setting new one and reloading.

Kodari AI
KodariFeb 24 at 9:07 am 7,098 (v2)

I’ll create a cross-platform IP management plugin with GeyserMC and Floodgate support.

IpMaster
A cross-platform IP management plugin supporting both Java and Bedrock editions through GeyserMC and Floodgate integration. Allows server administrators to configure default and custom IP addresses that players can use to connect. Features instant reload capability to apply new IP configurations without server restart. Manages multiple IP addresses and automatically handles port configurations from the server host.

Plugin created successfully! IpMaster now features:

  • Cross-platform support with GeyserMC and Floodgate detection for Bedrock players

  • Default IP configuration with enable/disable toggle

  • Multiple custom IPs managed through config with individual enable/disable states

  • Auto port detection from server settings or manual configuration

  • /ip reload command that instantly applies new IPs and disables old ones

  • /ip list to view all configured IPs and their status

  • /ip info for detailed system information including Bedrock support status

  • Color-coded status messages and comprehensive logging

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
8 536
src/main/java/com/ipmaster/IpMaster.java
package com.ipmaster;

import com.ipmaster.commands.IpCommand;
import com.ipmaster.managers.ConfigManager;
import com.ipmaster.managers.IpManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class IpMaster extends JavaPlugin {

    private ConfigManager configManager;
    private IpManager ipManager;
    private boolean geyserEnabled;
    private boolean floodgateEnabled;

    @Override
    public void onEnable() {
        try {
            loadPlugin();
            getLogger().info("IpMaster has been enabled!");
            getLogger().info("Bedrock support: " + (geyserEnabled || floodgateEnabled ? "Available" : "Not available"));
        } catch (Exception e) {
            getLogger().severe("Failed to enable IpMaster: " + e.getMessage());
            e.printStackTrace();
            getServer().getPluginManager().disablePlugin(this);
        }
    }

    @Override
    public void onDisable() {
        if (ipManager != null) {
            ipManager.shutdown();
        }
        getLogger().info("IpMaster has been disabled!");
    }

    public void loadPlugin() {
        this.configManager = new ConfigManager(this);
        this.ipManager = new IpManager(this);

        detectDependencies();

        registerCommands();

        ipManager.initialize();
    }

    public void reloadPlugin() {
        configManager.reload();
        ipManager.reload();
        detectDependencies();
    }

    private void registerCommands() {
        getCommand("ip").setExecutor(new IpCommand(this));
    }

    private void detectDependencies() {
        this.geyserEnabled = getServer().getPluginManager().getPlugin("Geyser-Spigot") != null;
        this.floodgateEnabled = getServer().getPluginManager().getPlugin("floodgate") != null;

        if (configManager.isDebug()) {
            getLogger().info("GeyserMC detected: " + geyserEnabled);
            getLogger().info("Floodgate detected: " + floodgateEnabled);
        }
    }
}