Izz Darwisy Bin Iskandar

make me a fabric 26.2 mod that can like show discord rpc . i want you to show im playing what server but the servername that i saved in the server list only don't show ip play on what version what loader and also addition it can be connect to existing rich presence using application id

Kodari AI
KodariOct 29 at 10:01 am 2
DiscordRichPresence
A Fabric mod that integrates Discord Rich Presence into Minecraft, displaying your current server name from the saved server list instead of IP addresses. It shows the server name, game version, and Fabric loader version in your Discord status. The mod supports custom application IDs for existing Discord applications, allowing seamless integration with your own Rich Presence setup. It automatically updates your presence when connecting to or disconnecting from servers, and shows the main menu state when not in-game. The mod is lightweight, configurable via a simple config file, and respects Discord's rate limits to avoid API spam.
  1. Set up a Fabric 26.2 client mod with the required build metadata.

  2. Add Discord IPC Rich Presence using the configured application ID.

  3. Publish only the saved server-list name (or “Singleplayer”), never the IP, version, or loader.

Created the Fabric 26.2 client mod. It sends the saved server-list name to Discord Rich Presence, shows “Singleplayer” in singleplayer, and clears the activity when you’re not in a world. It does not include the server IP, Minecraft version, or loader.

Set your Discord application ID in config/serverpresence.properties after the first launch:

Properties
applicationId=YOUR_APPLICATION_ID

Restart Minecraft with Discord running to connect.

Izz Darwisy Bin Iskandar

and it can be customised in Minecraft make sure it connects to discord an anyone can see

Kodari AI
KodariOct 29 at 10:04 am 2
  1. Add an in-game settings screen to customize Rich Presence.

  2. Check the Discord IPC setup so the configured application publishes a visible activity.

Added an in-game settings screen, opened with K. Enter your Discord Application ID there and save; the ID persists, and changing it reconnects. The screen also shows the Discord connection status, and the mod retries if Discord isn’t available.

The activity only sends the saved server-list name (or “Singleplayer”)—not the IP, Minecraft version, or loader. For others to see it, Discord must be running and your Activity Status sharing settings must allow it; the mod can’t override Discord’s privacy settings.

Izz Darwisy Bin Iskandar

keep in mind i use mojo launcher android so make sure any obstacle you handled it

Kodari AI
KodariOct 29 at 10:11 am 3
  1. Add touch-accessible settings buttons on the title and pause screens; keep K as a desktop shortcut.

  2. Show a clear Android RPC limitation instead of endlessly retrying an IPC connection Discord Android does not provide.

  3. Make Save/Cancel return to the screen that opened settings.

Added touch-friendly Server Presence buttons to the title and pause screens, and the settings screen now returns to the menu you opened it from. On Android it will report that Discord RPC is unsupported instead of repeatedly trying to connect.

The main obstacle can’t be fixed inside this mod: Discord’s Android app does not expose the desktop IPC interface required for custom Rich Presence. So this setup on Mojo Launcher will not publish your server activity to Discord. The mod needs Minecraft running with Discord Desktop; visibility also depends on each user’s Discord activity privacy settings. Mojo must additionally support this project’s Minecraft 26.2 and Java 25 requirements.

Izz Darwisy Bin Iskandar

try again

Kodari AI
KodariOct 29 at 10:12 am 1

I can’t make custom Discord Rich Presence publish from Mojo Launcher on Android. Discord’s Android app doesn’t provide the local RPC interface this mod needs, and an Application ID alone can’t replace it. The Android changes only make the settings touch-friendly and show that the connection is unsupported—they don’t publish activity.

To have others see the server name, Minecraft must run where Discord Desktop is available. A bot or relay can’t set Rich Presence on your personal Discord account.

[Generation stopped]

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
IMPORTANT.txt
settings.gradle
Code
9 680
src/main/java/com/kodari/serverpresence/ServerPresenceClient.java
package com.kodari.serverpresence;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.fabricmc.fabric.api.client.screen.v1.ScreenEvents;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.client.util.InputUtil;
import net.minecraft.client.gui.screen.GameMenuScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

import java.util.concurrent.atomic.AtomicReference;

public final class ServerPresenceClient implements ClientModInitializer {
    private static final System.Logger LOGGER = System.getLogger("Server Presence");
    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(
            Identifier.of("serverpresence", "main"));
    private static final KeyBinding OPEN_SETTINGS = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.serverpresence.open_settings", InputUtil.Type.KEYSYM, GLFW.GLFW_KEY_K, KEY_CATEGORY));

    @Override
    public void onInitializeClient() {
        PresenceConfig config = PresenceConfig.load();
        if (!config.hasApplicationId()) {
            LOGGER.log(System.Logger.Level.INFO,
                    "Press K in-game to set your Discord application ID and enable Rich Presence.");
        }
        AtomicReference<String> applicationId = new AtomicReference<>(config.applicationId());

        DiscordIpcClient discord = new DiscordIpcClient(config.applicationId());
        discord.start();

        ScreenEvents.AFTER_INIT.register((client, screen, scaledWidth, scaledHeight) -> {
            if (screen instanceof TitleScreen || screen instanceof GameMenuScreen) {
                screen.addDrawableChild(ButtonWidget.builder(Text.literal("Server Presence"), button ->
                                openSettings(client, screen, applicationId, discord))
                        .dimensions(scaledWidth - 150, scaledHeight - 38, 140, 28)
                        .build());
            }
        });

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (OPEN_SETTINGS.wasPressed()) {
                openSettings(client, client.currentScreen, applicationId, discord);
            }
            ServerInfo server = client.getCurrentServerEntry();
            String displayName = server != null
                    ? server.name
                    : client.isInSingleplayer() ? "Singleplayer" : null;
            discord.updateServer(displayName);
        });

        ClientLifecycleEvents.CLIENT_STOPPING.register(client -> discord.close());
    }

    private static void openSettings(MinecraftClient client, Screen parent,
                                     AtomicReference<String> applicationId, DiscordIpcClient discord) {
        client.setScreen(new PresenceSettingsScreen(parent, applicationId.get(), id -> {
            applicationId.set(id);
            discord.updateApplicationId(id);
        }, discord::getConnectionStatus));
    }
}