ancienthunter0

Make a Minecraft Fabric mod for version 1.21.4.

When I press the B key, a window opens showing these potion recipes:

Awkward + Golden Carrot = Night Vision Awkward + Magma Cream = Fire Resistance Awkward + Pufferfish = Water Breathing Awkward + Ghast Tear = Regeneration Awkward + Blaze Powder = Strength Awkward + Rabbit's Foot = Leaping Awkward + Spider Eye = Poison Awkward + Fermented Eye = Weakness Awkward + Phantom Membrane = Slow Falling Any Potion + Glowstone = Level II Any Potion + Redstone = Longer Duration Any Potion + Gunpowder = Splash Potion

The window title should say "Brewing Guide". Press ESC to close.

That's it. No other features. Export as .jar file.

Kodari AI
KodariMay 4 at 4:38 pm 5,471 (v2)

I’ll create a Fabric mod that opens a brewing recipe guide when pressing B.

BrewingGuide
A Fabric mod that displays a handy brewing recipe reference guide. Press B to open an in-game window showing all essential potion brewing recipes including base potions, modifiers, and enhancements. Covers night vision, fire resistance, water breathing, regeneration, strength, leaping, poison, weakness, slow falling, and potion modifiers like glowstone and redstone.

Fabric mod created successfully!

To build the .jar file:

  1. Run ./gradlew build (Linux/Mac) or gradlew.bat build (Windows)

  2. The mod .jar will be in build/libs/brewingguide-1.0.0.jar

Installation:

  • Place the .jar in your .minecraft/mods folder

  • Requires Fabric Loader 0.16+ and Fabric API for Minecraft 1.21.4

  • Press B in-game to open the brewing guide

  • Press ESC to close

The mod is client-side only and displays all 12 brewing recipes in a clean, centered GUI.

Kodari can make mistakes. Review important code before using.
Files
gradle
src
.gitignore
build.gradle
gradle.properties
settings.gradle
Code
9 200
src/main/java/com/brewingguide/BrewingGuideMod.java
package com.brewingguide;

import com.brewingguide.client.BrewingGuideScreen;
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.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import org.lwjgl.glfw.GLFW;

public class BrewingGuideMod implements ClientModInitializer {
    private static KeyBinding openGuideKey;
    
    @Override
    public void onInitializeClient() {
        openGuideKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.brewingguide.open",
            InputUtil.Type.KEYSYM,
            GLFW.GLFW_KEY_B,
            "category.brewingguide"
        ));
        
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (openGuideKey.wasPressed()) {
                if (client.player != null) {
                    client.setScreen(new BrewingGuideScreen());
                }
            }
        });
    }
}