gamingyt0274

Can make me a Minecraft mod for test tu is mod name have CheaterAI can add simple menu simple press : press for menu Button - Tap

Kodari AI
KodariAug 17 at 7:35 pm 2
CheaterAIMenu
A Fabric mod for Minecraft 1.21.1 that adds a CheaterAI system with a simple interactive menu. Players can press a keybind to open the menu, which displays a button interface. Tapping the button activates the CheaterAI functionality, providing an accessible and straightforward user experience for managing cheat-like features through an intuitive in-game GUI.
  1. Set up the Fabric 1.21.11 project and split common/client source sets.

  2. Add the CheaterAI mod entrypoints and a client keybind for opening the menu.

  3. Create a simple Tap button menu screen with a visible click response and required resources.

Created the CheaterAI Fabric 1.21.11 mod project.

  • Press Right Shift to open the CheaterAI Menu.

  • Added a Tap button.

  • Each click updates the displayed tap counter.

  • Included Fabric 1.21.11 Gradle setup, split client source set, mod metadata, and English translations.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
8 198
src/client/java/com/cheaterai/CheaterAIClient.java
package com.cheaterai;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

public class CheaterAIClient implements ClientModInitializer {
    private static final KeyBinding.Category CATEGORY = KeyBinding.Category.create(
        Identifier.of(CheaterAI.MOD_ID, "main")
    );

    private static final KeyBinding OPEN_MENU_KEY = KeyBindingHelper.registerKeyBinding(
        new KeyBinding("key.cheaterai.open_menu", GLFW.GLFW_KEY_RIGHT_SHIFT, CATEGORY)
    );

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (OPEN_MENU_KEY.wasPressed()) {
                if (client.currentScreen == null) {
                    client.setScreen(new CheaterAIScreen());
                }
            }
        });
    }
}