StevanXS

make a minecraft mod where the player can enable shoulder third person camera, the button to activate/deactivate is customizable through settings. The camera's are also dynamic where it also sways when there's movement. There will also be a keybind to switch between the right shoulder camera and left shoulder camera.

Kodari AI
KodariOct 22 at 4:06 pm 2
DynamicShoulderCamera
A Minecraft mod that adds an over-the-shoulder third-person camera system. Players can toggle the shoulder camera on/off via a customizable keybind, with the default binding configurable through settings. The camera dynamically sways and shifts with player movement, creating an immersive cinematic feel. A separate keybind allows seamless switching between right and left shoulder perspectives, giving players full control over their viewing angle during gameplay.
  1. Add the Fabric 26.3 client mod skeleton and camera/keybind behavior.

  2. Add configurable toggle and shoulder-switch bindings plus a YACL settings entry.

  3. Add the required assets, metadata, and dependencies.

Added the Shoulder Camera client mod. Press R to toggle the shoulder view and V to switch sides; remap both in Options → Controls. The Mod Menu settings page includes a movement-sway slider. Turning the camera off restores the perspective you had before enabling it.

StevanXS

Add an option to customize the camera distance/position (X and Y) and add tweening when switching shoulders. Enable crosshair when it's activated. and add another toggle button that allows the player to freely move the camera (without the player following the camera) while still on shoulder third person.

Kodari AI
KodariOct 22 at 4:29 pm 3
  1. Add configurable camera distance and X/Y offsets.

  2. Tween shoulder-side changes smoothly.

  3. Keep the crosshair visible in shoulder mode.

  4. Add a separate free-look toggle that lets the camera move independently.

  1. Added Camera Distance, Camera X Offset, and Camera Y Offset sliders to the settings page.

  2. Shoulder switching now eases smoothly between sides.

  3. The crosshair appears while shoulder camera is active.

  4. Added C as a toggle for free-look: mouse movement rotates the camera without turning the player. Remap it, along with R and V, under Options → Controls.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
14 465
src/client/java/com/kodari/shouldercamera/client/ShoulderCameraClient.java
package com.kodari.shouldercamera.client;

import com.mojang.blaze3d.platform.InputConstants;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keymapping.v1.KeyMappingHelper;
import net.minecraft.client.CameraType;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.resources.Identifier;

public class ShoulderCameraClient implements ClientModInitializer {
    public static final String MOD_ID = "shouldercamera";
    public static final KeyMapping.Category KEY_CATEGORY = KeyMapping.Category.register(
            Identifier.fromNamespaceAndPath(MOD_ID, "camera")
    );

    private static KeyMapping toggleCameraKey;
    private static KeyMapping switchShoulderKey;
    private static KeyMapping toggleFreeLookKey;
    private static boolean enabled;
    private static boolean leftShoulder;
    private static boolean freeLookEnabled;
    private static float freeLookYaw;
    private static float freeLookPitch;
    private static CameraType previousCameraType;

    @Override
    public void onInitializeClient() {
        ShoulderCameraConfig.HANDLER.load();
        toggleCameraKey = KeyMappingHelper.registerKeyMapping(new KeyMapping(
                "key.shouldercamera.toggle",
                InputConstants.Type.KEYBOARD,
                InputConstants.KEY_R,
                KEY_CATEGORY
        ));
        switchShoulderKey = KeyMappingHelper.registerKeyMapping(new KeyMapping(
                "key.shouldercamera.switch_shoulder",
                InputConstants.Type.KEYBOARD,
                InputConstants.KEY_V,
                KEY_CATEGORY
        ));
        toggleFreeLookKey = KeyMappingHelper.registerKeyMapping(new KeyMapping(
                "key.shouldercamera.toggle_free_look",
                InputConstants.Type.KEYBOARD,
                InputConstants.KEY_C,
                KEY_CATEGORY
        ));
        ClientTickEvents.START_CLIENT_TICK.register(ShoulderCameraClient::tick);
    }

    private static void tick(Minecraft client) {
        if (client.player == null) {
            if (enabled) {
                disable(client);
            }
            return;
        }

        while (toggleCameraKey.consumeClick()) {
            if (enabled) {
                disable(client);
            } else {
                enable(client);
            }
        }

        while (switchShoulderKey.consumeClick()) {
            if (enabled) {
                leftShoulder = !leftShoulder;
            }
        }

        while (toggleFreeLookKey.consumeClick()) {
            if (enabled) {
                freeLookEnabled = !freeLookEnabled;
                if (freeLookEnabled) {
                    freeLookYaw = client.player.getYRot();
                    freeLookPitch = client.player.getXRot();
                }
            }
        }

        if (enabled && client.options.getCameraType() != CameraType.THIRD_PERSON_BACK) {
            client.options.setCameraType(CameraType.THIRD_PERSON_BACK);
        }
    }

    private static void enable(Minecraft client) {
        previousCameraType = client.options.getCameraType();
        leftShoulder = false;
        enabled = true;
        client.options.setCameraType(CameraType.THIRD_PERSON_BACK);
    }

    private static void disable(Minecraft client) {
        enabled = false;
        leftShoulder = false;
        freeLookEnabled = false;
        if (previousCameraType != null) {
            client.options.setCameraType(previousCameraType);
            previousCameraType = null;
        }
    }

    public static boolean isEnabled() {
        return enabled;
    }

    public static boolean isLeftShoulder() {
        return leftShoulder;
    }

    public static boolean isFreeLookEnabled() {
        return freeLookEnabled;
    }

    public static float getFreeLookYaw() {
        return freeLookYaw;
    }

    public static float getFreeLookPitch() {
        return freeLookPitch;
    }

    public static void rotateFreeLook(float yawDelta, float pitchDelta) {
        freeLookYaw += yawDelta;
        freeLookPitch = Math.max(-90.0f, Math.min(90.0f, freeLookPitch + pitchDelta));
    }
}