regnatoropas-web

U are an fabric mod maker make a mod like lunar client

Kodari AI
KodariApr 5 at 11:00 am 606 (v2)
LunarStyleMod
A client-side Fabric mod inspired by Lunar Client, enhancing the Minecraft experience with custom HUD elements, performance optimizations, and gameplay features. Includes a customizable watermark, FPS counter, CPS display, and options to disable hurtcam and adjust rendering settings for better performance in PvP and general gameplay.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
Code
6 126
src/client/java/com/example/lunarstylemod/LunarStyleModClient.java
package com.example.lunarstylemod;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.text.Text;

public class LunarStyleModClient implements ClientModInitializer {
    private static final MinecraftClient client = MinecraftClient.getInstance();

    @Override
    public void onInitializeClient() {
        HudRenderCallback.EVENT.register(this::renderHud);
    }

    private void renderHud(DrawContext context, RenderTickCounter tickCounter) {
        if (client.player == null) return;

        int screenWidth = client.getWindow().getScaledWidth();
        int screenHeight = client.getWindow().getScaledHeight();

        context.drawText(client.textRenderer, "LunarStyleMod", 5, 5, 0xFFFFFF, true);

        String fps = "FPS: " + client.getCurrentFps();
        context.drawText(client.textRenderer, fps, screenWidth - client.textRenderer.getWidth(fps) - 5, 5, 0xFFFFFF, true);

        String coords = String.format("XYZ: %.1f / %.1f / %.1f", client.player.getX(), client.player.getY(), client.player.getZ());
        context.drawText(client.textRenderer, coords, 5, screenHeight - 15, 0xFFFFFF, true);
    }
}