silent_killer_99
📎 1 file 4,615 chars
📄
pasted-code-1786935647340.txt
txt 192 lines
▶
# XtremeBlur — Minecraft 1.21.11 Fabric Mod

Create a complete, working **Minecraft Java Edition 1.21.11 Fabric client-side mod** named **XtremeBlur**.

## Main Feature

Add a smooth, professional **Motion Blur** effect for gameplay.

The blur should:
- Look clean and modern.
- Have smooth transitions.
- Avoid excessive visual artifacts.
- Be highly optimized for low-end PCs.
- Minimize FPS drops and GPU/VRAM usage.
- Work correctly with **Sodium** and **Fabric API**.
- Not cause crashes or rendering conflicts.

## Target Environment

- Minecraft Java Edition **1.21.11**
- Fabric Loader **0.19.3**
- Fabric API **0.141.6+1.21.11**
- Client-side only
- Compatible with Sodium
- Java 21
- Low-end integrated graphics should be supported.

## INVENTORY GUI

Press **M** to open the XtremeBlur configuration INVENTORY GUI.

The INVENTORY GUI should contain:

1. **Motion Blur**
   - ON / OFF toggle

2. **Blur Strength**
   - Adjustable percentage/value
   - Recommended default: **50–60**

3. **Blur Smoothness**
   - Adjustable
   - Should control how smoothly the blur transitions.

4. **Blur Quality**
   - Low
   - Medium
   - High

5. **Reset to Default**
   - Restores recommended settings.

6. **DONE**
   - Properly positioned inside the INVENTORY GUI.
   - Must never appear outside the INVENTORY GUI box.

Settings should automatically save and remain after restarting Minecraft.

## Commands

Add these client-side commands:

`/XtremeBlur ON`

`/XtremeBlur OFF`

`/XtremeBlur ON 75`

`/XtremeBlur OFF 75`

Commands must be implemented using the **correct Minecraft 1.21.11 Fabric command API**.

Do NOT use outdated command classes or APIs from older Minecraft versions.

The command implementation must NOT cause:

- `NoClassDefFoundError`
- `LanguageAdapterException`
- `ClassCastException`
- `VerifyError`
- Entrypoint crashes

## Watermark

Display a small watermark in the **bottom-right corner**:

**Made By SpinXtreme**

Formatting:
- `Made By` → Yellow
- `SpinXtreme` → Red

Make it clean and subtle.

There must be **no black rectangle/black box** behind the watermark.

## Rendering Requirements

Implement the blur safely so it does not interfere with Minecraft's rendering pipeline.

Important:
- Do not perform multiple blur passes on the same frame incorrectly.
- Avoid triggering errors such as:

`IllegalStateException: Can only blur once per frame.`

- Do not inject into rendering methods in a way that creates recursive or duplicate blur calls.
- Make sure the blur is applied exactly once per intended frame/pass.
- Handle INVENTORY GUI rendering separately from world rendering where necessary.
- Ensure the blur works correctly with Sodium.

## Performance

Optimize XtremeBlur specifically for low-end hardware.

Priorities:

1. Stable FPS
2. Low GPU usage
3. Low VRAM usage
4. Smooth blur
5. Fast startup
6. Minimal memory usage

Avoid unnecessary framebuffer allocations and expensive shader operations.

Use sensible defaults for low-end PCs.

## Crash Prevention

The finished mod must be compatible with Minecraft **1.21.11**, not older Minecraft versions.

Pay special attention to Minecraft mappings and API changes.

Do not reference classes that no longer exist in 1.21.11, such as outdated command API classes.

Make sure the Fabric entrypoint declared in `fabric.mod.json` actually implements the correct initializer interface.

For example, the client entrypoint must correctly implement:

`net.fabricmc.api.ClientModInitializer`

Do not accidentally register a command class itself as the Fabric client entrypoint.

## Mod Metadata

Mod ID:

`xtremeblur`

Mod Name:

`XtremeBlur`

Author:

`SpinXtreme`

Description:

`A smooth and optimized client-side motion blur mod for Minecraft.`

Environment:

`client`

## Final Requirements

Provide a complete buildable Fabric project with:

- Correct `fabric.mod.json`
- Correct Fabric client entrypoint
- Correct Minecraft 1.21.11 mappings
- Correct command implementation
- Motion blur renderer
- Configuration system
- INVENTORY GUI
- Keybind
- Watermark
- Settings persistence
- Sodium compatibility
- Performance optimization
- No outdated Minecraft APIs
- No duplicate blur calls
- No black rectangle in the bottom-right
- No INVENTORY GUI positioning bugs

The final project must build into a working `.jar` that can be placed directly into the Minecraft `mods` folder.

The final JAR should be named:

`XtremeBlur-V1.jar`
Kodari AI
KodariAug 17 at 3:03 am 2
XtremeBlur
A client-side Fabric mod for Minecraft 1.21.11 that adds smooth, optimized motion blur with an inventory GUI (press M) for adjusting blur strength, smoothness, and quality. Includes client commands (/XtremeBlur ON/OFF), a subtle "Made By SpinXtreme" watermark, persistent settings, and performance optimizations for low-end hardware with full Sodium compatibility.
  1. Create the Fabric 1.21.11 client project and metadata with the requested XtremeBlur-V1.jar archive name.

  2. Add persistent blur settings, client commands, the M keybind, and an inventory-style configuration screen.

  3. Add guarded post-processing activation and the bottom-right colored watermark, with client-only mixin wiring.

Created the complete XtremeBlur Fabric 1.21.11 client mod project.

  • Fabric/Loom setup targeting Minecraft 1.21.11, Fabric Loader 0.19.3, Fabric API 0.141.6, Java 21.

  • Archive configured as XtremeBlur-V1.jar.

  • Added persistent JSON configuration with defaults:

    • Motion Blur: enabled

    • Strength: 55%

    • Smoothness: 65%

    • Quality: Medium

  • Added inventory-style configuration GUI opened with M.

  • Added client commands:

    • /XtremeBlur ON

    • /XtremeBlur OFF

    • /XtremeBlur ON 75

    • /XtremeBlur OFF 75

  • Added guarded, movement-triggered post-processing with duplicate-frame protection.

  • Added Sodium-safe client rendering approach using Minecraft’s post-processing pipeline.

  • Added bottom-right watermark with yellow Made By and red SpinXtreme.

  • Added client-only entrypoint and GameRenderer accessor mixin.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
13 487
src/client/java/com/spinxtreme/xtremeblur/XtremeBlurClient.java
package com.spinxtreme.xtremeblur;

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.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public final class XtremeBlurClient implements ClientModInitializer {
    public static final String MOD_ID = "xtremeblur";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
    private static final Identifier WATERMARK_ID = Identifier.of(MOD_ID, "watermark");
    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(
        Identifier.of(MOD_ID, "main")
    );
    private static KeyBinding openSettingsKey;

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

        openSettingsKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.xtremeblur.open",
            InputUtil.Type.KEYSYM,
            GLFW.GLFW_KEY_M,
            KEY_CATEGORY
        ));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (openSettingsKey.wasPressed()) {
                client.setScreen(new BlurScreen());
            }
            MotionBlurRenderer.tick(client);
        });

        HudElementRegistry.addLast(WATERMARK_ID, (context, tickCounter) -> {
            MinecraftClient client = MinecraftClient.getInstance();
            if (client.options.hudHidden || client.currentScreen != null) {
                return;
            }

            Text watermark = Text.literal("Made By ").styled(style -> style.withColor(0xFFFF55))
                .append(Text.literal("SpinXtreme").styled(style -> style.withColor(0xFF5555)));
            int x = context.getScaledWindowWidth() - client.textRenderer.getWidth(watermark) - 6;
            int y = context.getScaledWindowHeight() - client.textRenderer.fontHeight - 6;
            context.drawTextWithShadow(client.textRenderer, watermark, x, y, 0xFFFFFFFF);
        });
    }
}