David

Create and compile a working client-only Fabric mod for Minecraft Java Edition 1.21.11.

Features:

  • Press O to open a settings menu.
  • Adjust camera FOV from 0.50x to 2.00x.
  • Adjust first-person hand and held-item X, Y and Z positions from -1.00 to 1.00 blocks.
  • Include an optional samurai hat visible on my own player in third person.
  • Settings reset when Minecraft closes.
  • No server-side changes.

Use Java 21 and compatible Fabric dependencies. Fix all compilation errors and provide the actual compiled .jar file for Minecraft 1.21.11, not just source code. Test the build before giving me the download.

Kodari AI
KodariOct 28 at 12:41 pm 3
ClientCustomizer
A client-only Fabric mod for Minecraft 1.21.11 that adds an in-game settings menu accessible by pressing the O key. Players can adjust the camera field of view from 0.50x to 2.00x and modify the first-person hand and held item X, Y, and Z positions within a range of -1.00 to 1.00 blocks. The mod also includes an optional samurai hat rendered on the local player's head in third-person view. All settings are transient and reset when the game closes, with no server-side modifications required.
  1. Set up a client-only Fabric 1.21.11 project with transient settings and an O keybind.

  2. Build the owo-ui settings screen for FOV and hand-position controls.

  3. Add client mixins for camera FOV, first-person item offsets, and the third-person samurai hat.

Implemented the client-only mod: O opens the settings menu, with a 0.50×–2.00× FOV slider, X/Y/Z hand and item offsets from −1.00 to 1.00 blocks, and an optional third-person hat toggle for your player. Settings stay in memory and reset when Minecraft closes; there are no server-side changes. The hat uses your skin’s existing hat-layer colors for its broad, flattened silhouette.

I can’t confirm a successful test build from the results available here, so I can’t claim a verified JAR yet. To build and download it in Kodari:

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

  2. Click Compile in the window that opens.

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

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
13 318
src/client/java/dev/kodari/cameratweaks/CameraTweaksClient.java
package dev.kodari.cameratweaks;

import dev.kodari.cameratweaks.client.CameraSettingsScreen;
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 final class CameraTweaksClient implements ClientModInitializer {

    public static final String MOD_ID = "cameratweaks";
    private static KeyBinding openSettings;

    @Override
    public void onInitializeClient() {
        KeyBinding.Category category = KeyBinding.Category.create(Identifier.of(MOD_ID, "main"));
        openSettings = KeyBindingHelper.registerKeyBinding(
                new KeyBinding("key.cameratweaks.open_settings", GLFW.GLFW_KEY_O, category)
        );

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (openSettings.wasPressed()) {
                if (client.currentScreen == null) {
                    client.setScreen(CameraSettingsScreen.createScreen(client.currentScreen));
                }
            }
        });
    }
}