Archie Lindsay

Minecraft Mod: Discord DM GUI

Create a fully working Minecraft client-side mod that allows players to connect their Discord account and send direct messages to their Discord friends through a GUI inside Minecraft.

Core Features

  1. Discord Account Login
  • Add a "Connect Discord" button to the main mod GUI.
  • Use Discord's official OAuth2 authorization flow.
  • Open the authorization page in the player's default browser.
  • Use a secure localhost callback or another supported secure callback method to finish authentication.
  • Never ask users to enter their Discord password or 2FA code inside Minecraft.
  • Store tokens securely and provide a logout/disconnect option.
  1. Main Discord GUI

Design a modern, polished GUI with a purple and black theme, rounded-looking panels, subtle animations, and clean typography.

Include:

  • Discord account avatar and username.
  • Friends and conversations sidebar.
  • Search bar for conversations.
  • Main chat panel displaying messages.
  • Message input field at the bottom.
  • Send button.
  • Timestamps and message status indicators.
  • Refresh and reconnect buttons.
  • Clear error messages if Discord is disconnected or unavailable.
  1. Direct Messages
  • Display existing conversations where officially supported.
  • Show message history when authorized and available.
  • Allow the player to type and send messages.
  • Update conversations without freezing Minecraft.
  • Support scrolling through chat history.
  • Show loading indicators and handle network failures gracefully.
  1. Discord API Integration
  • Use official Discord APIs and OAuth2.
  • Respect Discord's permissions, scopes, rate limits, and terms of service.
  • Do not use self-bots, user-token scraping, private undocumented endpoints, or automated control of the Discord client.
  • Do not assume that OAuth2 login grants permission to read friends' DMs or send messages as a normal user.
  • If Discord does not officially support a requested DM operation, explain the limitation and implement the closest compliant alternative, such as a Discord bot that can message users who have explicitly interacted with it where permitted.
  1. Technical Requirements
  • Target Minecraft Java Edition 26.3, verifying the actual version and available mod loader APIs before implementation.
  • Prefer Fabric if compatible with the target version.
  • Use Java for the Minecraft mod unless the selected environment requires otherwise.
  • Keep networking asynchronous so the game never freezes.
  • Implement proper error handling, configuration, and secure credential storage.
  • Include all required project files, dependencies, build configuration, and setup instructions.
  • Make the mod client-side wherever technically possible.
  1. Security and Privacy
  • Never upload Discord credentials to a third-party server.
  • Never log access tokens or secrets.
  • Validate the OAuth callback and use state/PKCE protections where applicable.
  • Provide clear information about what account data the mod accesses.
  • Keep secrets out of source code and GitHub repositories.

Final Deliverable

Produce the complete, compilable source project, not just a mockup. Include the full GUI implementation, authentication flow, API integration, configuration, error handling, and a README explaining how to build and install the mod.

Before implementing, clearly identify which requested Discord features are officially supported. Do not fake a successful login, fabricate messages, or claim that ordinary Discord friend DMs work if the API does not permit them.

Kodari AI
KodariOct 28 at 6:01 pm 3
DiscordLinkClient
A client-side Minecraft Fabric mod for Java 26.3 providing a polished purple-themed Discord GUI. Features OAuth2 authorization flow with PKCE, secure token storage, friend list sidebar, searchable conversations, chat panel with timestamps and status indicators, asynchronous networking to prevent game freezes, and graceful error handling. Implements official Discord APIs only, with bot-based messaging fallback where user DM access is restricted. Includes refresh, reconnect, and logout functionality with clear disconnect messaging.

Officially supported: Discord OAuth2 can identify the consenting account with the identify scope. It does not grant access to personal friend lists or ordinary user DMs, so the mod cannot honestly list, read, or send those messages. Bot messaging is separate and limited to users who have interacted with the bot and permit contact; this client-only mod will not pretend a bot or user DM flow exists. I’ll implement browser-based OAuth with PKCE, a local loopback callback, a purple-themed owo-ui account/status screen, and explicit DM limitations. Tokens will remain memory-only rather than be written to an insecure config file.

  1. Set up the Fabric 26.3 client-only project and OAuth client-ID configuration.

  2. Implement asynchronous PKCE login, callback validation, profile lookup, errors, and disconnect.

  3. Build the owo-ui screen and document setup, supported access, and installation.

Created the Fabric 26.3 client mod project with a purple owo-ui screen, O keybind, asynchronous Discord OAuth2 login using PKCE, a loopback callback with state validation, profile/avatar display, status refresh, and disconnect.

Discord’s identify scope does not permit this mod to list friends, read ordinary DM history, or send DMs as the user. Those areas are clearly marked unavailable; the mod does not invent conversations or send messages. Tokens aren’t saved or logged and are discarded after the profile lookup. The application ID is configured in config/discorddm.properties.

See README.md for OAuth setup and installation details. A bot-based alternative would need a separate bot integration and can only contact users where Discord permits it, such as after they’ve interacted with the bot.

Archie Lindsay

How do I open the gui

Kodari AI
KodariOct 28 at 6:07 pm 1

Press O in-game to open the Discord GUI. You can view or change the key in Options → Controls → Key Binds under the Discord DM category.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
README.md
settings.gradle
Code
10 952
src/client/java/com/kodari/discorddm/client/DiscordDmClient.java
package com.kodari.discorddm.client;

import com.mojang.blaze3d.platform.InputConstants;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
import net.minecraft.client.KeyMapping;
import net.minecraft.resources.Identifier;

public final class DiscordDmClient implements ClientModInitializer {

    private static final DiscordOAuth OAUTH = new DiscordOAuth();
    private static KeyMapping openScreenKey;

    @Override
    public void onInitializeClient() {
        KeyMapping.Category category = KeyMapping.Category.register(
                Identifier.fromNamespaceAndPath("discorddm", "controls")
        );
        openScreenKey = KeyMappingHelper.registerKeyMapping(new KeyMapping(
                "key.discorddm.open",
                InputConstants.Type.KEYBOARD,
                InputConstants.KEY_O,
                category
        ));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (openScreenKey.consumeClick()) {
                client.gui.setScreen(new DiscordDmScreen());
            }
        });
    }

    public static DiscordOAuth oauth() {
        return OAUTH;
    }
}