Aniket Das

ApsEssential – Minecraft World Sharing Mod

Developer: AniketPlaysz Mod Name: ApsEssential Version: 1.0 Minecraft Version: 1.21.11 Mod Loader: Fabric Account Support: Premium + Cracked Accounts

  1. Overview

ApsEssential is a Minecraft Fabric mod that allows players to share their singleplayer worlds with friends over the internet without needing to purchase or configure a dedicated Minecraft server.

Players can turn their existing singleplayer world into an online multiplayer server using a simple command. Friends can join the exact same world using a generated IP address and port.

  1. Enable World Hosting

When a player creates a new singleplayer world and enters it, they can type the following command in chat:

"/assen enable"

After executing this command, ApsEssential starts preparing the world for multiplayer hosting.

  1. Hosting Countdown

After executing "/assen enable", a title appears on the player's screen with a 5-second countdown.

Example title:

Your World Is Being Turned Into a Server In...

5 4 3 2 1

After the countdown finishes, the world becomes available for remote connections.

  1. Automatic IP Generation

Once hosting starts successfully, ApsEssential generates a public server address with a port.

Example:

"145.678.90:25656"

The generated address must:

  • Be displayed in GREEN color.
  • Be selectable and copyable.
  • Include the public relay address and connection port.
  • Use a unique address for each hosting session.
  • Display the current hosting status.

Example screen:

APS ESSENTIAL

[ ONLINE ]

YOUR WORLD IS NOW ONLINE!

IP ADDRESS: "145.678.90:25656"

[ COPY IP ]

The example IP is illustrative, not a real server address.

  1. Joining a Friend's World

Friends can join the host's world using these steps:

  1. Open Minecraft Java Edition.
  2. Navigate to Multiplayer.
  3. Select Direct Connection.
  4. Paste the IP address provided by the host.
  5. Click Join Server.

After connecting, the friend joins the exact same world in which the host is currently playing.

All players share the same world, including its blocks, entities, inventories, and world progression.

  1. Main Features
  • Convert singleplayer worlds into multiplayer sessions.
  • Automatic public IP and port generation.
  • Five-second hosting countdown.
  • Green-colored IP display.
  • One-click copy IP functionality.
  • Friends can join from anywhere.
  • No manual port forwarding.
  • Cracked Minecraft account compatibility.
  • Premium Minecraft account compatibility.
  • Existing world support.
  • Real-time multiplayer synchronization.
  • Host can continue playing while friends join.
  • Automatic LAN server port detection.
  • Hosting status display.
  • Stop hosting whenever desired.
  1. Commands

"/assen enable" Starts hosting the current singleplayer world.

"/assen disable" Stops hosting and closes the multiplayer session.

"/assen info" Displays the current hosting status, IP address, and port.

  1. Technical Requirements
  • Minecraft Java Edition 1.21.11.
  • Fabric Loader.
  • Fabric API.
  • ApsEssential installed.
  • Active internet connection.
  • Public relay/tunneling backend.
  1. Cracked Account Support

ApsEssential must support both premium and cracked Minecraft accounts.

Players using offline-mode Minecraft launchers should be able to connect to hosted worlds.

The backend must implement appropriate connection security, player authorization, and rate limiting.

  1. Important Developer Requirements

This must be a fully functional mod, not just a visual interface or simulated IP generator.

ApsEssential requires a real networking backend or relay service to expose the host's LAN server to the internet.

The mod must:

  • Detect the actual LAN server port.
  • Establish a connection with the relay backend.
  • Generate a real, working public connection address.
  • Forward incoming player connections to the host's world.
  • Support multiple simultaneous players.
  • Synchronize gameplay correctly.
  • Handle disconnections and hosting failures.
  • Display errors when hosting cannot start.
  • Properly shut down relay connections when hosting is disabled.
  1. Final Goal

Create a polished, lightweight and fully functional Minecraft world-sharing mod named ApsEssential, developed by AniketPlaysz.

The main goal is simple:

Create a singleplayer world → Type "/assen enable" → Wait 5 seconds → Copy the generated IP → Send it to friends → Friends join your world!

No complicated server setup. No manual port forwarding. Just simple multiplayer world sharing.

Kodari AI
KodariOct 31 at 10:03 am 3
ApsEssential
Converts singleplayer Minecraft worlds into online multiplayer sessions via Fabric mod. Players type "/assen enable" to trigger a 5-second countdown, after which the mod detects the LAN server port, establishes a connection with a relay backend, and generates a unique public IP address with port displayed in green with copy functionality. Supports premium and cracked accounts, multiple simultaneous players, real-time world synchronization, and hosting status display. Commands include enable, disable, and info. Handles disconnections, hosting failures, and proper relay shutdown.
  • Create the Fabric 1.21.11 project and /assen client commands.

  • Add a five-second countdown and real integrated-server LAN hosting/status controls.

  • Avoid inventing a public relay address; remote joining needs a real TCP relay backend, which this project does not include.

Created the Fabric 1.21.11 ApsEssential project. /assen enable starts a five-second countdown, then opens a real LAN listener; /assen info reports its status, and /assen disable closes that listener without closing the singleplayer world. The green chat entry copies the LAN port.

Internet sharing is not implemented: this project has no TCP relay backend, so it does not generate or display a fake public IP. Friends outside the host’s reachable LAN cannot join yet, and relay-side authorization and cracked-account handling are not included. A companion Discord bot project on Kodari can provide session/control APIs, but remote play still requires a genuine TCP-forwarding relay.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
8 342
src/client/java/com/aniketplaysz/apsessential/ApsEssentialClient.java
package com.aniketplaysz.apsessential;

import com.aniketplaysz.apsessential.mixin.IntegratedServerAccessor;
import com.aniketplaysz.apsessential.mixin.ServerNetworkIoAccessor;
import io.netty.channel.ChannelFuture;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.server.integrated.IntegratedServer;
import net.minecraft.server.ServerNetworkIo;
import net.minecraft.client.network.LanServerPinger;
import net.minecraft.text.ClickEvent;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;

import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

public class ApsEssentialClient implements ClientModInitializer {
    private static int countdownTicks = -1;

    @Override
    public void onInitializeClient() {
        ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) ->
                dispatcher.register(ClientCommandManager.literal("assen")
                        .then(ClientCommandManager.literal("enable")
                                .executes(context -> enable(context.getSource())))
                        .then(ClientCommandManager.literal("disable")
                                .executes(context -> disable(context.getSource())))
                        .then(ClientCommandManager.literal("info")
                                .executes(context -> info(context.getSource())))
                        .executes(context -> {
                            context.getSource().sendFeedback(Text.literal("Usage: /assen <enable|disable|info>"));
                            return 1;
                        })));

        ClientTickEvents.END_CLIENT_TICK.register(ApsEssentialClient::tickCountdown);
    }

    private static int enable(FabricClientCommandSource source) {
        MinecraftClient client = source.getClient();
        IntegratedServer server = client.getServer();

        if (server == null) {
            source.sendError(Text.literal("ApsEssential can only host a singleplayer world."));
            return 0;
        }
        if (server.isRemote()) {
            source.sendError(Text.literal("LAN hosting is already online on port " + server.getServerPort() + "."));
            return 0;
        }
        if (countdownTicks >= 0) {
            source.sendError(Text.literal("The hosting countdown is already running."));
            return 0;
        }

        countdownTicks = 100;
        showCountdown(client, 5);
        source.sendFeedback(Text.literal("ApsEssential hosting countdown started."));
        return 1;
    }

    private static int disable(FabricClientCommandSource source) {
        MinecraftClient client = source.getClient();
        IntegratedServer server = client.getServer();

        if (countdownTicks >= 0) {
            countdownTicks = -1;
            client.inGameHud.clearTitle();
            source.sendFeedback(Text.literal("Hosting countdown cancelled."));
            return 1;
        }
        if (server == null || !server.isRemote()) {
            source.sendError(Text.literal("LAN hosting is not online."));
            return 0;
        }
        if (!closeLanListener(server)) {
            source.sendError(Text.literal("Could not safely close the LAN listener; the world was left running."));
            return 0;
        }

        source.sendFeedback(Text.literal("LAN hosting stopped. Your singleplayer world is still running."));
        return 1;
    }

    private static int info(FabricClientCommandSource source) {
        MinecraftClient client = source.getClient();
        IntegratedServer server = client.getServer();

        if (server == null) {
            source.sendFeedback(Text.literal("Status: not in a singleplayer world."));
        } else if (countdownTicks >= 0) {
            source.sendFeedback(Text.literal("Status: hosting countdown in progress."));
        } else if (server.isRemote()) {
            sendLanStatus(client, server.getServerPort());
        } else {
            source.sendFeedback(Text.literal("Status: world is local only; LAN hosting is offline."));
        }
        return 1;
    }

    private static void tickCountdown(MinecraftClient client) {
        if (countdownTicks < 0) {
            return;
        }

        if (client.getServer() == null || client.player == null) {
            countdownTicks = -1;
            client.inGameHud.clearTitle();
            return;
        }

        countdownTicks--;
        if (countdownTicks > 0 && countdownTicks % 20 == 0) {
            showCountdown(client, countdownTicks / 20);
        } else if (countdownTicks == 0) {
            countdownTicks = -1;
            startLanHosting(client);
        }
    }

    private static void showCountdown(MinecraftClient client, int seconds) {
        client.inGameHud.setTitle(Text.literal("Your World Is Being Turned Into a Server In..."));
        client.inGameHud.setSubtitle(Text.literal(Integer.toString(seconds)));
        client.inGameHud.setTitleTicks(0, 22, 0);
    }

    private static void startLanHosting(MinecraftClient client) {
        IntegratedServer server = client.getServer();
        if (server == null || client.player == null) {
            return;
        }

        var gameMode = client.interactionManager == null ? null : client.interactionManager.getCurrentGameMode();
        boolean cheatsAllowed = server.getPlayerManager().areCheatsAllowed();
        int port = ThreadLocalRandom.current().nextInt(1024, 65536);

        if (!server.openToLan(gameMode, cheatsAllowed, port)) {
            client.player.sendMessage(Text.literal("ApsEssential could not open a LAN port. Try enabling hosting again."), false);
            return;
        }

        sendLanStatus(client, server.getServerPort());
        client.player.sendMessage(Text.literal("No public relay is configured. This listener is reachable only where your network allows it."), false);
    }

    private static void sendLanStatus(MinecraftClient client, int port) {
        if (client.player == null) {
            return;
        }

        Text copyPort = Text.literal("LAN port: " + port + " (click to copy)")
                .formatted(Formatting.GREEN)
                .styled(style -> style.withClickEvent(new ClickEvent.CopyToClipboard(Integer.toString(port))));
        client.player.sendMessage(Text.literal("ApsEssential status: ONLINE"), false);
        client.player.sendMessage(copyPort, false);
        client.player.sendMessage(Text.literal("This is a LAN port, not a public Internet address."), false);
    }

    private static boolean closeLanListener(IntegratedServer server) {
        int port = server.getServerPort();
        ServerNetworkIo networkIo = server.getNetworkIo();
        List<ChannelFuture> channels = ((ServerNetworkIoAccessor) networkIo).apsessential$getChannels();
        boolean listenerClosed = false;

        synchronized (channels) {
            Iterator<ChannelFuture> iterator = channels.iterator();
            while (iterator.hasNext()) {
                ChannelFuture future = iterator.next();
                SocketAddress localAddress = future.channel().localAddress();
                if (localAddress instanceof InetSocketAddress address && address.getPort() == port) {
                    iterator.remove();
                    future.channel().close();
                    listenerClosed = true;
                    break;
                }
            }
        }

        if (!listenerClosed) {
            return false;
        }

        IntegratedServerAccessor accessor = (IntegratedServerAccessor) server;
        LanServerPinger pinger = accessor.apsessential$getLanPinger();
        if (pinger != null) {
            pinger.interrupt();
            accessor.apsessential$setLanPinger(null);
        }
        accessor.apsessential$setLanPort(-1);
        return true;
    }
}