Taher Gareeb

Create a lightweight Minecraft client-side recording mod with the following exact requirements.

Game compatibility

  • Minecraft Java Edition 1.21.11
  • Fabric Loader
  • Fabric API
  • The mod must work in single-player and multiplayer without requiring server installation.

Main goal

I want a simple in-game recording mod inspired by Flashback's recording technology, but designed for normal gameplay videos rather than cinematic replays.

Recording system

  • Add a simple keyboard shortcut, preferably F5 if it does not conflict with Minecraft controls, to start and stop recording.
  • Record normal gameplay, including the complete visible game interface: inventory screens, hotbar, hearts, hunger bar, crosshair, chat, menus, and other HUD elements.
  • Preserve the actual gameplay as it appears on screen, including opening and closing inventory.
  • Save recordings as standard MP4 video files that can be edited in common video editors.
  • Allow the user to choose video resolution and frame rate.
  • Provide simple recording status feedback and a configurable keybind.

Performance requirements

My PC has an Intel Core i5 4th-generation processor, 8 GB RAM, a hard disk drive, and no dedicated graphics card.

Performance is the highest priority. I want to minimize gameplay stuttering and recording frame drops.

Investigate a replay-based architecture similar to Flashback, where gameplay data is captured during play and video rendering happens afterward, instead of continuously encoding every frame during gameplay.

However, because I need the real inventory and HUD visible, do not simply hide the interface or record a replay that cannot reproduce the actual inventory interactions.

If replay rendering cannot reliably reproduce the complete interface, implement a separate lightweight screen-recording mode or another technically valid solution.

Do not claim that recording will have zero lag. Explain the performance trade-offs and provide low-end PC defaults.

User interface

  • Keep the controls minimal.
  • Include Start Recording, Stop Recording, and Open Recordings Folder.
  • Provide basic quality settings without complicated editing tools.
  • Do not add unnecessary features, shaders, visual effects, or heavy background processing.

Development requirements

  • Generate a complete, buildable Fabric mod project for Minecraft 1.21.11.
  • Use the correct version-specific Minecraft mappings and APIs.
  • Include all required Gradle files, mod metadata, dependencies, and source code.
  • Verify that the project compiles before providing the downloadable JAR.
  • If full MP4 recording or replay rendering cannot be implemented reliably, explain the limitation instead of generating a fake or nonfunctional feature.
  • Provide installation instructions and any required dependencies.

The final result should be a simple, reliable, low-overhead Minecraft recording mod that captures real gameplay with the complete visible interface.

Kodari AI
KodariOct 12 at 2:56 pm 5
LightweightGameplayRecorder
A Fabric mod for Minecraft 1.21.11 that records real gameplay with full HUD visibility using a two-phase architecture. Captures lightweight frame data during play (minimizing stutter on low-end PCs), then renders to MP4 after stopping. Features configurable F5 keybind, resolution/frame-rate settings, start/stop controls, and recordings folder access. Prioritizes performance for i5-4th-gen CPUs with HDD storage via deferred encoding.
  1. Capture the rendered client framebuffer so recordings include gameplay and every visible UI interaction.

  2. Encode MP4 asynchronously through FFmpeg, with a bounded frame queue and low-end defaults to limit gameplay impact.

  3. Add a small control screen, configurable shortcut, recording-folder access, and basic quality choices.

  4. Create the complete client-only Fabric project and document the FFmpeg requirement and performance trade-offs.

Created a client-only Fabric 1.21.11 recorder that captures the rendered game framebuffer, including the HUD, chat, menus, and inventory screens. A replay-only approach would not reliably reproduce those actual screen interactions, so this records what the client renders instead.

  • Controls: F8 toggles recording; F9 opens the controls screen. Both keybinds can be changed in Minecraft’s Controls settings. The screen has Start Recording, Stop Recording, Open Recordings Folder, and cycling quality controls.

  • Defaults: 480p at 15 FPS, with FFmpeg’s ultrafast H.264 preset, one encoding thread, and a bounded frame queue. Settings also include 720p, 1080p, source resolution, and 10–30 FPS.

  • Output: MP4 files go in the game directory’s recordings/ folder. This records video only—no game or microphone audio.

  • Dependencies: Fabric Loader and Fabric API are required. owo-lib is declared for bundling with the download. FFmpeg with libx264 is also required and is not bundled; put it on PATH or set its executable path in config/screenrecorder.properties.

  • Performance: Frame readback and encoding are kept off the continuous gameplay path where possible, and overload can cause repeated frames. Readback still uses memory bandwidth and can cause stutter; for this PC, keep the defaults and consider setting Minecraft’s own resolution near 854×480 before recording. There is no zero-lag guarantee.

  • Compatibility: No server-side mod is required; this works in single-player and multiplayer.

The source project is in place, but I can’t claim a successful compile or provide a verified JAR without a successful build result. To build and download it in Kodari: desktop: click Compile in the top bar; phone: tap ⋮ → Compile Project. Click Compile in the window, then Download when it succeeds. If it fails, use Auto-fix in 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
11 687
src/client/java/com/kodari/screenrecorder/CaptureModClient.java
package com.kodari.screenrecorder;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import org.lwjgl.glfw.GLFW;

public final class CaptureModClient implements ClientModInitializer {
    private static final Mp4Recorder RECORDER = new Mp4Recorder();
    private static boolean initialized;
    private static KeyBinding toggleRecordingKey;
    private static KeyBinding openControlsKey;

    @Override
    public void onInitializeClient() {
        toggleRecordingKey = KeyBindingHelper.registerKeyBinding(
                new KeyBinding("key.screenrecorder.toggle", GLFW.GLFW_KEY_F8, KeyBinding.Category.MISC)
        );
        openControlsKey = KeyBindingHelper.registerKeyBinding(
                new KeyBinding("key.screenrecorder.open_controls", GLFW.GLFW_KEY_F9, KeyBinding.Category.MISC)
        );

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            if (!initialized) {
                RECORDER.initialize(client.runDirectory.toPath());
                initialized = true;
            }

            while (toggleRecordingKey.wasPressed()) {
                if (RECORDER.isRecording()) {
                    RECORDER.stop();
                } else {
                    RECORDER.start(client);
                }
            }

            while (openControlsKey.wasPressed()) {
                client.setScreen(new RecorderScreen(RECORDER, client));
            }
        });

        ClientLifecycleEvents.CLIENT_STOPPING.register(client -> RECORDER.stopAndWait());
    }

    public static void captureFrame(MinecraftClient client) {
        RECORDER.capture(client);
    }
}