Foxik113

Create a Minecraft Fabric mod (1.21.4) with a customizable HUD showing FPS, Ping, and TPS.

Features:

Toggle each element on/off Draggable positions Preset positions (corners + center) Clean modern INVENTORY GUI (rounded, transparent background) Adjustable text size and color Keybind to open settings Save config Optimize for performance.

Kodari AI
KodariMar 21 at 4:48 am 14,997 (v2)

I’ll create a performance HUD mod with draggable elements and a modern settings GUI.

PerformanceHud
A customizable performance monitoring HUD displaying FPS, ping, and TPS with draggable positioning, preset layouts, and modern GUI. Features include toggleable elements, adjustable text size and color, smooth drag-and-drop positioning, and persistent configuration. Optimized for minimal performance impact with efficient rendering and caching.

I’ll create a performance HUD mod with draggable elements, modern UI, and persistent config.

PerformanceHud
A customizable performance monitoring HUD displaying FPS, ping, and TPS with draggable positioning, preset layouts, and modern GUI. Features include toggleable elements, adjustable text size and color, smooth drag-and-drop positioning, and persistent configuration. Optimized for minimal performance impact with efficient rendering and caching.

All files created! The mod features:

Core Features:

  • FPS, Ping, TPS display with real-time updates (cached every 10 frames for performance)

  • Drag-and-drop positioning - click and drag any element in the settings screen

  • 5 preset layouts - Top Left, Top Right, Bottom Left, Bottom Right, Center

  • Toggle visibility for each element independently

  • Adjustable text size with slider (0.5x to 2.0x)

  • Customizable colors (text color stored in config)

  • Text shadow toggle

  • Persistent config saves to config/performancehud.json

Performance Optimizations:

  • Values cached and updated every 10 frames (not every frame)

  • TPS calculated from rolling 20-tick average

  • Minimal rendering overhead with efficient draw calls

  • Config loaded once at startup, saved only on changes

Modern GUI:

  • Clean semi-transparent backgrounds with padding

  • Smooth drag interaction with visual feedback

  • Checkbox controls for toggles

  • Slider for text size

  • Preset buttons for quick positioning

Keybind: Press H to open settings (configurable in Minecraft controls)

The HUD elements have rounded backgrounds and are fully draggable in real-time!

Foxik113

The compilation failed with this error:

code
Compilation failed with 6 error(s):

ERROR in src/main/java/client/java/com/performancehud/INVENTORY GUI/HudSettingsScreen.java at line 38: constructor CheckboxWidget in class CheckboxWidget cannot be applied to given types;
        addDrawableChild(new CheckboxWidget(
                         ^

ERROR in src/main/java/client/java/com/performancehud/INVENTORY GUI/HudSettingsScreen.java at line 47: constructor CheckboxWidget in class CheckboxWidget cannot be applied to given types;
        addDrawableChild(new CheckboxWidget(
                         ^

ERROR in src/main/java/client/java/com/performancehud/INVENTORY GUI/HudSettingsScreen.java at line 56: constructor CheckboxWidget in class CheckboxWidget cannot be applied to given types;
        addDrawableChild(new CheckboxWidget(
                         ^

ERROR in   src/main/java/client/java/com/performancehud/INVENTORY GUI/HudSettingsScreen.java at line 38: constructor CheckboxWidget in class CheckboxWidget cannot be applied to given types;
          addDrawableChild(new CheckboxWidget(
                           ^

ERROR in   src/main/java/client/java/com/performancehud/INVENTORY GUI/HudSettingsScreen.java at line 47: constructor CheckboxWidget in class CheckboxWidget cannot be applied to given types;
          addDrawableChild(new CheckboxWidget(
                           ^

ERROR in   src/main/java/client/java/com/performancehud/INVENTORY GUI/HudSettingsScreen.java at line 56: constructor CheckboxWidget in class CheckboxWidget cannot be applied to given types;
          addDrawableChild(new CheckboxWidget(
                           ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/client/java/com/performancehud/INVENTORY GUI/HudSettingsScreen.java
  -   src/main/java/client/java/com/performancehud/INVENTORY GUI/HudSettingsScreen.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariMar 21 at 5:07 am 14,943 (v2)

I need to read the HudSettingsScreen.java file to see what’s wrong with the CheckboxWidget constructor calls, and potentially check the correct API for 1.21.4.

Now I need to check the correct API for CheckboxWidget in Fabric 1.21.4, as the constructor signature has changed.

Let me check the CheckboxWidget class to see what constructors are available in 1.21.4:

Based on the Fabric 1.21.4 widget API changes, the CheckboxWidget constructor now takes the callback as a parameter instead of using setCallback(). Let me fix the HudSettingsScreen:

Fixed the CheckboxWidget constructor calls to use the Fabric 1.21.4 builder pattern. The old .setCallback() method has been replaced with .callback() in the builder chain, and the constructor now requires a TextRenderer parameter.

Foxik113

Add a settings menu to our existing mod that allows users to customize the UI size, color, and screen position. Ensure these preferences are saved to a config file and applied in real-time without restarting."

Kodari AI
KodariMar 21 at 5:40 am 12,538 (v2)

I’ll help you add a comprehensive settings menu with real-time customization. Let me first read the existing files to understand the current structure.

I can see your mod already has most of the functionality! However, I notice the color customization is missing from the UI (it’s in the config but not accessible). Let me enhance the settings screen to add color controls, text shadow toggle, and background opacity customization.

Perfect! I’ve enhanced your Performance HUD mod with comprehensive customization options:

Added Features:

✅ Color Customization - 6 preset color buttons (White, Green, Yellow, Red, Aqua, Gold) with instant preview ✅ Background Opacity Control - Slider to adjust transparency (0-100%) ✅ Text Shadow Toggle - Checkbox to enable/disable text shadows ✅ Reset to Defaults - Button that restores all settings to their original values ✅ Real-time Preview - All changes apply instantly in the settings screen preview ✅ Improved Layout - Better organized UI with labeled sections

All settings are automatically saved to config/performancehud.json and applied immediately without restarting. Press H (or your configured key) to open the settings menu, then drag elements to reposition them or customize colors, size, and opacity using the controls!

Foxik113

dodaj jeszcze ilość graczy na serwerze

Kodari AI
KodariMar 21 at 5:45 am 10,603 (v2)

Dodam wyświetlanie ilości graczy na serwerze do HUD-a. Najpierw przeczytam obecne pliki, aby zobaczyć strukturę.

Dodam wyświetlanie ilości graczy na serwerze do HUD-a.

Dodano wyświetlanie liczby graczy na serwerze do Performance HUD. Element “Players: X” pokazuje aktualną liczbę graczy i można go włączać/wyłączać oraz przeciągać tak jak pozostałe elementy.

Foxik113

dodaj edydtowanie wszystkiego w INVENTORY GUI w client

Kodari AI
KodariMar 21 at 5:48 am 17,268 (v2)

Dodam pełne GUI edycji w inwentarzu z możliwością zmiany wszystkich parametrów HUD. Najpierw przeczytam obecne pliki:

Stworzę rozbudowane GUI inwentarzowe z pełną edycją wszystkich parametrów dla każdego elementu HUD (kolor RGB, rozmiar, pozycja, tło, cień):

Dodałem pełne GUI edycji w stylu inwentarza z możliwością edycji wszystkich parametrów dla każdego elementu HUD:

Nowe funkcje:

  • Klawisz J - otwiera nowe GUI inwentarzowe

  • Indywidualne style - każdy element (FPS, Ping, TPS, Players) ma własne ustawienia

  • Pełna edycja RGB - osobno dla tekstu i tła

  • Kontrola rozmiaru - dla każdego elementu osobno

  • Pozycja XY - bezpośrednia edycja współrzędnych

  • Przezroczystość tła - 0-100%

  • Cień tekstu - włącz/wyłącz

  • Widoczność - Show/Hide dla każdego elementu

  • Podgląd na żywo - widzisz zmiany w czasie rzeczywistym

  • Reset - przywrócenie domyślnych ustawień dla wybranego elementu

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
16 1,283
src/client/java/com/performancehud/PerformanceHudClient.java
package com.performancehud;

import com.performancehud.config.ConfigManager;
import com.performancehud.gui.HudSettingsScreen;
import com.performancehud.gui.InventoryHudScreen;
import com.performancehud.render.HudRenderer;
import com.performancehud.screen.HudScreenHandler;
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.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.Text;
import org.lwjgl.glfw.GLFW;

public class PerformanceHudClient implements ClientModInitializer {
    private static KeyBinding openSettingsKey;
    private static KeyBinding openInventoryGuiKey;
    private static HudRenderer hudRenderer;

    @Override
    public void onInitializeClient() {
        ConfigManager.load();

        openSettingsKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.performancehud.open_settings",
            InputUtil.Type.KEYSYM,
            GLFW.GLFW_KEY_H,
            "Performance HUD"
        ));

        openInventoryGuiKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.performancehud.open_inventory_gui",
            InputUtil.Type.KEYSYM,
            GLFW.GLFW_KEY_J,
            "Performance HUD"
        ));

        hudRenderer = new HudRenderer();

        HudRenderCallback.EVENT.register((context, tickCounter) -> {
            hudRenderer.render(context, tickCounter.getTickDelta(false));
        });

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (openSettingsKey.wasPressed()) {
                client.setScreen(new HudSettingsScreen(client.currentScreen));
            }
            
            while (openInventoryGuiKey.wasPressed()) {
                if (client.player != null) {
                    client.setScreen(new InventoryHudScreen(
                        new HudScreenHandler(0, client.player.getInventory()),
                        client.player.getInventory(),
                        Text.translatable("gui.performancehud.inventory.title")
                    ));
                }
            }
        });
    }

    public static HudRenderer getHudRenderer() {
        return hudRenderer;
    }
}