Viren Khakhodiya

minecraft mod gui changer jo gui scale ko presntage ke hisaab se set ka option provide kare gui scale ko adjust kar paye 1.21.11 hona chiye jar file honi chiye

Kodari AI
KodariSep 17 at 6:15 pm 1
GuiScaleAdjuster
A Minecraft Fabric mod for version 1.21.11 that provides a graphical interface to adjust the GUI scale percentage. Features a settings panel with a slider and input field, allowing players to fine-tune their interface zoom level from 50% to 200%. The mod saves the selected scale preference and applies it in real-time, offering a user-friendly alternative to the default command-line method. Includes a keybinding to quickly open the adjustment menu during gameplay.
  1. Create a Fabric 1.21.11 client mod with a percentage-based GUI scale screen.

  2. Add Gradle/Fabric metadata, client entrypoint, keybinding, slider UI, localization, and icon-free minimal resources.

  3. Configure the build to produce a distributable JAR.

Fabric 1.21.11 GUI Scale Percentage mod project तैयार है।

  • G दबाने पर GUI Scale Percentage screen खुलेगी।

  • Slider range: 50%–200%

  • Changes तुरंत लागू होते हैं।

  • Reset button original GUI scale वापस सेट करता है।

  • Minecraft की vanilla सीमा के कारण percentage को nearest whole-number GUI scale में map किया गया है।

  • Minecraft: 1.21.11

  • Java: 21

  • Output JAR: build/libs/gui-scale-percentage-1.0.0.jar

JAR बनाने के लिए project root में चलाएँ:

Shell
gradle build

Generated mod JAR को mods folder में रखें।

Viren Khakhodiya

gradlew build/libs/gui-scale-percentage-1.0.0.jar

Kodari AI
KodariSep 17 at 6:16 pm 1

The generation was stopped before any content could be produced.

Viren Khakhodiya

gradle build/libs/gui-scale-percentage-1.0.0.jar

Kodari AI
KodariSep 17 at 6:16 pm 1

सही command JAR बनाने के लिए:

Shell
./gradlew build

Windows पर:

Shell
gradlew.bat build

बनने के बाद JAR यहाँ मिलेगा:

Plain Text
build/libs/gui-scale-percentage-1.0.0.jar

gradle build/libs/...jar गलत है, क्योंकि Gradle को output JAR path नहीं बल्कि build task देना होता है।

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
8 272
src/client/java/com/kodari/guiscale/GuiScalePercentageClient.java
package com.kodari.guiscale;

import com.kodari.guiscale.client.GuiScaleScreen;
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.util.Identifier;
import org.lwjgl.glfw.GLFW;

public class GuiScalePercentageClient implements ClientModInitializer {
    private static final KeyBinding.Category CATEGORY = KeyBinding.Category.create(
            Identifier.of(GuiScalePercentage.MOD_ID, "general")
    );

    private static KeyBinding openScreenKey;

    @Override
    public void onInitializeClient() {
        openScreenKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.gui_scale_percentage.open",
                GLFW.GLFW_KEY_G,
                CATEGORY
        ));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (openScreenKey.wasPressed()) {
                client.setScreen(new GuiScaleScreen(client.currentScreen));
            }
        });
    }
}