1smxcker

Every time someone purchases something on this Minecraft server, a GG wave happens. I want you to help me create a mod that automatically types “gg” in chat whenever a wave happens. This is what usually appears when a GG wave starts: “Type ‘gg’ in chat to show some love and receive 1 free credit!”

Kodari AI
KodariOct 10 at 6:37 am 1
GGAutoTyper
A Fabric mod for Minecraft 1.21.1 that automatically sends "gg" in chat when a GG wave message appears. It listens for the specific server message "Type 'gg' in chat to show some love and receive 1 free credit!" and responds by typing "gg" in the chat, ensuring players never miss the opportunity to earn free credits.
  1. Detect the GG-wave announcement from incoming chat.

  2. Send gg once per matching wave using the client’s chat API.

  3. Add the minimal Fabric mod metadata and entrypoint.

Created the Fabric client mod. It listens for the server’s GG-wave announcement, matches it case-insensitively (including curly or straight quotes), and sends gg in chat when it appears.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
5 113
src/client/java/com/kodari/ggwave/GgWaveClient.java
package com.kodari.ggwave;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents;
import net.minecraft.client.MinecraftClient;

import java.util.Locale;

public class GgWaveClient implements ClientModInitializer {
    private static final String WAVE_ANNOUNCEMENT = "type 'gg' in chat to show some love and receive 1 free credit!";

    @Override
    public void onInitializeClient() {
        ClientReceiveMessageEvents.GAME.register((message, overlay) -> {
            String normalizedMessage = message.getString()
                    .toLowerCase(Locale.ROOT)
                    .replace('‘', '\'')
                    .replace('’', '\'');

            if (normalizedMessage.contains(WAVE_ANNOUNCEMENT)) {
                MinecraftClient client = MinecraftClient.getInstance();
                if (client.getNetworkHandler() != null) {
                    client.getNetworkHandler().sendChatMessage("gg");
                }
            }
        });
    }
}