Build the ChatPlus Controls companion client mod for Fabric Minecraft 1.21.11 in this project. This client mod exists because a Paper server plugin alone cannot read physical keyboard input. Implement a working Fabric client mod with Gradle/build metadata and documentation. Do not create tests or ask to build; Kodari will compile after your changes.

Wire protocol with ChatPlus Paper plugin: custom plugin message channel chatplus:controls. Client-to-server payload is exactly one unsigned byte: 1 requests opening the ability menu; 2 activates the equipped ability. Server-to-client payload is exactly two bytes: first byte 0x11, second byte is the GLFW key code used to activate the ability (initial B=66). The mod must send these actions only when the player is connected and the server supports/registers this channel; no key inputs should be sent to arbitrary servers lacking the channel. On receiving [0x11,keyCode], update its ability activation key binding and persist the selected key locally if feasible. Input request for opening menu is Right Shift. Activation default is B and can be changed from the normal Minecraft Controls options as well as accepting server sync; do not send commands/chat text. Ensure activation key changes supported by the server GUI can synchronize to this client.

Use Fabric's supported client keybinding and custom payload APIs for 1.21.11; implement networking in a version-correct way. Register Right Shift menu key and configurable activation key, communicate only the one-byte action messages on channel chatplus:controls, and tolerate channel absence/disconnect safely. Add a clear README giving installation steps (clients who need controls install mod, server installs Paper plugin), keybind controls, protocol, and explicit version scope. Keep the mod narrowly scoped; no gameplay ability implementation or ownership grants belong client side.

Kodari AI
KodariOct 24 at 8:16 am 2
ChatPlusControlsClient
A Fabric client mod for Minecraft 1.21.11 that enables physical keyboard input for the ChatPlus Paper server plugin. It registers a Right Shift keybinding to request the ability menu and a configurable activation key (default B) to activate abilities, sending one-byte payloads over the `chatplus:controls` custom plugin message channel. The mod listens for server-synced key codes (0x11 prefix) to update the activation binding and persists it locally. It safely tolerates servers without the channel, sending no input to unsupported servers. Includes Gradle build metadata, a README with installation steps, keybind controls, wire protocol details, and version scope.
  1. Define the Fabric 1.21.11 client entrypoint, Gradle metadata, and scoped README.

  2. Implement keybinds and channel-guarded custom-payload networking with server key sync.

  3. Persist the synced activation key through Minecraft’s normal options where supported.

Created the Fabric 1.21.11 ChatPlus Controls companion mod. It registers Right Shift for the ability-menu request and a configurable B activation key, sends only the one-byte actions when the server supports chatplus:controls, and applies and saves server-synced activation keys.

Added Gradle and Fabric metadata, keybind translations, and a README covering installation, controls, protocol, and version scope. The client mod contains no gameplay or ability logic.

Update only the ChatPlus Controls companion documentation for compatibility with the server adding abilities 7 Operator's Authority and 8 Time Stop. Read the current README and edit it to clarify that no client update or wire-protocol change is needed: abilities and their effects are server-side, and the existing action-2 activation input handles whichever ability is currently equipped, including Time Stop; Operator's Authority is applied server-side when eligible owner equips it. Preserve existing version/install/keybind/protocol documentation. Do not change source or networking behavior; do not add tests or build.

Kodari AI
KodariOct 24 at 9:28 am 1

I’ll update only the README, preserving its installation, version, keybind, and protocol details while clarifying server-side handling for abilities 7 and 8.

Updated only README.md with the compatibility note: abilities 7 and 8 need no client update or protocol change; action 2 activates whichever ability is equipped, while Operator’s Authority eligibility and application remain server-side. Existing installation, version, keybind, and protocol documentation is preserved.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
README.md
settings.gradle
Code
8 230
src/client/java/com/chatplus/controls/ChatPlusControlsClient.java
package com.chatplus.controls;

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.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

public final class ChatPlusControlsClient implements ClientModInitializer {
    private static final byte OPEN_ABILITY_MENU = 1;
    private static final byte ACTIVATE_EQUIPPED_ABILITY = 2;
    private static final int ABILITY_KEY_SYNC = 0x11;

    private static final KeyBinding.Category CATEGORY = KeyBinding.Category.create(
            Identifier.of("chatplus_controls", "controls")
    );

    private static KeyBinding openMenuKey;
    private static KeyBinding activationKey;

    @Override
    public void onInitializeClient() {
        PayloadTypeRegistry.playC2S().register(ChatPlusControlsPayload.ID, ChatPlusControlsPayload.C2S_CODEC);
        PayloadTypeRegistry.playS2C().register(ChatPlusControlsPayload.ID, ChatPlusControlsPayload.S2C_CODEC);

        openMenuKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.chatplus_controls.open_ability_menu",
                GLFW.GLFW_KEY_RIGHT_SHIFT,
                CATEGORY
        ));
        activationKey = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.chatplus_controls.activate_ability",
                GLFW.GLFW_KEY_B,
                CATEGORY
        ));

        ClientPlayNetworking.registerGlobalReceiver(ChatPlusControlsPayload.ID, (payload, context) -> {
            if (Byte.toUnsignedInt(payload.action()) != ABILITY_KEY_SYNC) {
                return;
            }

            int keyCode = Byte.toUnsignedInt(payload.keyCode());
            activationKey.setBoundKey(InputUtil.Type.KEYSYM.createFromCode(keyCode));
            KeyBinding.updateKeysByCode();
            context.client().options.write();
        });

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (openMenuKey.wasPressed()) {
                sendAction(OPEN_ABILITY_MENU);
            }
            while (activationKey.wasPressed()) {
                sendAction(ACTIVATE_EQUIPPED_ABILITY);
            }
        });
    }

    private static void sendAction(byte action) {
        if (!ClientPlayNetworking.canSend(ChatPlusControlsPayload.ID)) {
            return;
        }

        try {
            ClientPlayNetworking.send(new ChatPlusControlsPayload(action, (byte) 0));
        } catch (IllegalStateException ignored) {
            // The connection may close between the support check and packet send.
        }
    }
}