technotrooper_1
📎 1 file 1,327 chars
📄
pasted-code-1793108759745.txt
txt 18 lines
▶
Create a complete Minecraft Java 1.21.11 Fabric mod called Firework Duration Indicator.

Show a HUD indicator near the crosshair displaying the remaining elytra firework boost duration. Detect actual boost time, update it continuously, and hide the indicator when the boost ends.

Features:
- Two visual styles: a shrinking duration bar and the actual Minecraft firework rocket texture.
- Customizable size, width, height, X/Y position, alignment, colors, opacity, borders, and timer text.
- Optional remaining-time display.
- Presets including compact PvP mode.
- Save settings between game launches.
- Integrate with Fabric Mod Menu using a Configure button and a native Minecraft settings screen with sliders, checkboxes, dropdowns, and reset buttons.
- Mod Menu must be optional.

Compatibility: Minecraft Java 1.21.11, Fabric Loader, Java 21.

Stability is essential. Use correct 1.21.11 rendering APIs. Prevent duplicate blur calls and the crash “can only blur once per frame.” Avoid duplicate rendering, rendering-state corruption, and FPS drops. Do not use blur unless absolutely necessary.

Deliver a compiled, working downloadable JAR, not just source code. Fix compilation errors and ensure every setting actually works. Test boost detection, GUI customization, configuration saving, and crash-prone rendering paths.
Kodari AI
KodariOct 27 at 2:04 pm 4
FireworkBoostHUD
A Minecraft Fabric mod displaying a HUD indicator near the crosshair showing remaining elytra firework boost duration. Features two visual styles including a shrinking duration bar and the actual rocket texture. Offers customizable size, position, alignment, colors, opacity, borders, and optional timer text. Includes presets with compact PvP mode and persistent settings. Integrates with Fabric Mod Menu through an optional Configure button, providing a native settings screen with sliders, checkboxes, dropdowns, and reset buttons. Handles boost detection continuously, hides the indicator upon boost end, and prevents rendering-state corruption and blur-related crashes.
  1. Build the Fabric mod, persistent settings, and accurate boost tracking.

  2. Add a configurable crosshair HUD and YACL settings screen, with optional Mod Menu integration.

  3. Include required metadata/assets and package it for Kodari’s compile-and-download workflow.

Created the Fabric 1.21.11 mod with a live boost indicator, vanilla rocket icon and shrinking-bar styles, configurable layout and colors, saved settings, default and compact PvP presets, and a YACL settings screen. Mod Menu is optional; without it, the HUD still works, but the Configure button is unavailable. Rendering uses one HUD registration and no blur.

I can’t run Minecraft in-game tests from this session, so I can’t claim the boost detection or settings screen has been runtime-verified. To get the JAR in Kodari:

  1. Click Compile in the top bar (on phone: ⋮ → Compile Project).

  2. Click Compile in the window.

  3. When it succeeds, click Download on the build. If it fails, use Auto-fix or Fix.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
IMPORTANT.txt
manifest.kod
settings.gradle
Code
14 648
src/client/java/com/kodari/fireworkdurationindicator/FireworkDurationIndicatorClient.java
package com.kodari.fireworkdurationindicator;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.Identifier;

public final class FireworkDurationIndicatorClient implements ClientModInitializer {
    public static final String MOD_ID = "firework_duration_indicator";
    private static boolean initialized;

    @Override
    public void onInitializeClient() {
        if (initialized) {
            return;
        }
        initialized = true;

        MinecraftClient client = MinecraftClient.getInstance();
        FireworkConfig.load(client.runDirectory.toPath()
                .resolve("config")
                .resolve(MOD_ID + ".properties"));

        ClientTickEvents.END_CLIENT_TICK.register(BoostTracker::tick);
        HudElementRegistry.addLast(
                Identifier.of(MOD_ID, "duration_indicator"),
                HudRenderer::render
        );
    }
}