De Mini DJ

Develop a Minecraft mod that replaces the default multiplayer button on the main menu with a "Join MJZM" button. When clicked, it should automatically connect the player to the server mjzm.minehost.gg, while ensuring compatibility with both the latest Minecraft version and server authentication protocols. Additionally, include a customizable option for users to change the server address if needed. and works oon mc java 1.21.11

Kodari AI
KodariOct 15 at 3:13 pm 2
MJZMQuickJoin
Replaces the default multiplayer button on the main menu with a "Join MJZM" button that directly connects players to mjzm.minehost.gg. Includes a config file allowing users to customize the server address. Compatible with Minecraft Java 1.21.11 and standard authentication protocols, ensuring seamless one-click server access.
  1. Replace the main-menu Multiplayer button with a one-click “Join MJZM” connection.

  2. Add an editable server-address setting and include a default address of mjzm.minehost.gg.

  3. Set up the new Fabric 1.21.11 project and register the mixin.

Implemented a client-side Fabric mod for Minecraft 1.21.11. The main-menu Multiplayer button is replaced with Join MJZM, which connects to mjzm.minehost.gg using Minecraft’s normal connection and authentication flow.

The server address is editable in config/joinmjzm.properties under server-address. The mod creates this file with the default address when the title screen loads.

De Mini DJ

can you make the button for the join purple and blue and can you make it fabric

Kodari AI
KodariOct 15 at 3:20 pm 1
  1. Update the existing Join MJZM button to use purple-and-blue styling.

  2. Verify the project is configured as a Fabric 1.21.11 mod and correct it if needed.

The Join MJZM button now has a purple-and-blue background that brightens on hover. The project is configured as a Fabric mod for Minecraft 1.21.11, with Fabric API added as a dependency. The configurable server address is unchanged.

De Mini DJ

can you fix this

📎 1 file 2,515 chars
📄
pasted-code-1792077741246.txt
txt 24 lines
▶
	... 2 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:380)
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:237)
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202)
	at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:435)
	... 8 more
Caused by: org.spongepowered.asm.mixin.throwables.MixinApplyError: Mixin [joinmjzm.mixins.json:TitleScreenMixin from mod joinmjzm] from phase [DEFAULT] in config [joinmjzm.mixins.json] FAILED during APPLY
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinError(MixinProcessor.java:685)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.handleMixinApplyError(MixinProcessor.java:636)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:367)
	... 11 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.InvalidMixinException: @Shadow method method_37066(Lnet/minecraft/class_364;)V in joinmjzm.mixins.json:TitleScreenMixin from mod joinmjzm was not located in the target class net.minecraft.class_442. No refMap loaded.
	at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachSpecialMethod(MixinPreProcessorStandard.java:445)
	at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachShadowMethod(MixinPreProcessorStandard.java:421)
	at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attachMethods(MixinPreProcessorStandard.java:349)
	at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.attach(MixinPreProcessorStandard.java:308)
	at org.spongepowered.asm.mixin.transformer.MixinPreProcessorStandard.createContextFor(MixinPreProcessorStandard.java:286)
	at org.spongepowered.asm.mixin.transformer.MixinInfo.createContextFor(MixinInfo.java:1308)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:214)
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:437)
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:418)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:351)
	... 11 more
Kodari AI
KodariOct 15 at 3:26 pm 1

Fixed the mixin crash. remove and addDrawableChild are inherited from Screen, not declared by TitleScreen, so their @Shadows could not resolve. The mixin now calls them through a Screen invoker, and that invoker is registered in the mixin config.

De Mini DJ

can you do that you don't need a microsoft account to do this action?

Kodari AI
KodariOct 15 at 3:36 pm 1

No. A Fabric mod can’t bypass Minecraft’s Microsoft authentication. Joining still uses the game’s normal login session, and the server must accept that authenticated connection.

The Join MJZM button can connect you automatically once you’ve launched Minecraft with a valid account; it can’t make the game usable without one.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
10 278
src/client/java/com/kodari/joinmjzm/mixin/TitleScreenMixin.java
package com.kodari.joinmjzm.mixin;

import com.kodari.joinmjzm.client.ServerConfig;
import com.kodari.joinmjzm.mixin.ScreenInvoker;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.Drawable;
import net.minecraft.client.gui.Element;
import net.minecraft.client.gui.Selectable;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.screen.multiplayer.ConnectScreen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.ClickableWidget;
import net.minecraft.client.network.ServerAddress;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableTextContent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(TitleScreen.class)
public abstract class TitleScreenMixin {
    @Inject(method = "init", at = @At("TAIL"))
    private void joinmjzm$replaceMultiplayerButton(CallbackInfo callbackInfo) {
        TitleScreen screen = (TitleScreen) (Object) this;
        ClickableWidget multiplayerButton = null;

        for (Element child : screen.children()) {
            if (child instanceof ClickableWidget widget
                    && widget.getMessage().getContent() instanceof TranslatableTextContent content
                    && content.getKey().equals("menu.multiplayer")) {
                multiplayerButton = widget;
                break;
            }
        }

        if (multiplayerButton == null) {
            return;
        }

        int x = multiplayerButton.getX();
        int y = multiplayerButton.getY();
        int width = multiplayerButton.getWidth();
        int height = multiplayerButton.getHeight();
        ScreenInvoker screenInvoker = (ScreenInvoker) (Object) screen;
        screenInvoker.joinmjzm$remove(multiplayerButton);
        ServerConfig.loadAddress();

        screenInvoker.joinmjzm$addDrawableChild(ButtonWidget.builder(Text.translatable("joinmjzm.button"), button -> {
            String address = ServerConfig.loadAddress();
            ConnectScreen.connect(
                    screen,
                    MinecraftClient.getInstance(),
                    ServerAddress.parse(address),
                    new ServerInfo("MJZM", address, ServerInfo.ServerType.OTHER),
                    false,
                    null
            );
        }).dimensions(x, y, width, height).build());
    }
}