Create a Fabric 1.21.11 client companion mod for the SuperpowersSMP Paper plugin. The user explicitly requests genuine local microphone speech recognition, not a simulation: implement real offline recognition using a suitable packaged local engine and model, respecting licensing and cross-platform native deployment, or clearly report any limitation instead of faking it. Explicit opt-in permission, stop microphone when disabled, never save or upload recordings, visible listening indicator, optional push-to-talk, confidence threshold, debounce; recognize only current server-synchronized power's configurable commands. Separate dark-purple/black voice settings screen, accessible via client command /superpower voice where technically possible: enable/disable, microphone and output device selection and tests, speech test, per-ability custom words, reset/save. Default voice phrases for primary/secondary/ultimate/transform respectively: Enderman VOID/SHADOW/VOID STORM/ENDERMAN; Blaze INFERNO/FIRE/INFERNO STORM/BLAZE; Cloning DUPLICATE/DEFEND/CLONE ARMY/CLONING; Evoker ETERNAL/FANGS/TOTEM/EVOKER; Iron Golem AWAKEN/GUARD/IRON FIST/GOLEM; Warden SONIC/DARKNESS/EARTHQUAKE/WARDEN; Wither DESTRUCTION/SKULL/WITHER STORM/WITHER; Phantom SKY/DIVE/PHANTOM FLIGHT/PHANTOM; Guardian OCEAN/LASER/TIDAL WAVE/GUARDIAN; Spider WEB/POISON/WEB STORM/SPIDER; Witch POTION/HEAL/MAGIC/WITCH; Ghast BURN/FLOAT/EXPLOSION/GHAST; Wolf PACK/ATTACK/PACK DEFENSE/WOLF; Skeleton ARROW/MULTISHOT/DEATH RAIN/SKELETON; Dragon DRACARYS/FLIGHT/DRAGON RAGE/DRAGON. Include configurable real keyboard controls R/F/G/H and separate keybind screen with duplicate detection/save/cancel, configurable HUD showing synchronized power and cooldowns where server support exists. Client sends only ability identifiers, never damage or raw audio; server must independently validate. Paper plugin is still being developed and its protocol is not yet known: make networking isolated and document exact protocol requirements for later integration, do not claim interoperability until integrated. Include installation, dependencies/model setup and honest limitations in README. Do not create tests.

Kodari AI
KodariNov 12 at 4:58 pm 5
VoicePowerClient
Fabric 1.21.11 client companion mod providing genuine offline local microphone speech recognition for SuperpowersSMP Paper plugin integration. Implements real speech-to-text using packaged local engine with explicit opt-in permission, microphone stop on disable, no recording storage or uploads, visible listening indicator, optional push-to-talk, confidence threshold, and debounce. Features dark-purple/black voice settings screen accessible via /superpower voice command with microphone/output device selection, speech testing, per-ability custom words, and reset/save functionality. Includes configurable keyboard controls R/F/G/H with separate keybind screen featuring duplicate detection, synchronized power/cooldown HUD display, and isolated networking layer documenting exact protocol requirements for future Paper plugin integration. Client transmits only ability identifiers with server-side validation independence, never raw audio or damage data. Provides comprehensive README covering installation, dependencies, model setup, and honest limitations.
  • Create the client shell, default key bindings and phrase catalog.

  • Keep voice capture and server actions disabled until a real recognition engine and agreed protocol are integrated.

  • Document the missing integration and its security requirements.

Created an unfinished Fabric 1.21.11 client shell with a voice status screen, rebindable R/F/G/H controls, and the requested default phrase catalog.

Voice recognition and ability activation do not work yet. No microphone is opened, and the Paper protocol remains undefined. The README documents the missing features and integration requirements.

Continue existing Fabric client shell. README and CompanionClient currently confirm recognition is absent. Implement genuine offline microphone speech recognition (e.g. Vosk Java with proper runtime/native dependencies and user-provided licensed model with clear setup); no placeholders or fake results. Implement explicit consent, enable/disable, close capture on disable/disconnect/shutdown, memory-only audio, live indicator, PTT, confidence threshold and duplicate suppression, microphone selection/test and configurable phrases and separate settings UI as feasible. Keep recognized activations disabled until authoritative power sync and validated server protocol are integrated; isolate a callback for later integration. Preserve existing bindings and phrase catalog. Document precisely what works and all dependency/model/platform limitations. Do not add tests or claim runtime verification.

Kodari AI
KodariNov 12 at 5:06 pm 22

I’ll add local recognition and its controls while keeping ability activation disconnected from the server protocol.

Implemented an offline Vosk speech-test path with session-only microphone consent, input selection, configurable phrases, confidence filtering, push-to-talk and a live indicator.

A model must be installed separately; setup and platform limitations are in the README. Ability activation remains disabled until authoritative power synchronization and the Paper protocol are integrated. Runtime behavior has not been verified.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
README.md
settings.gradle
Code
11 515
src/client/java/dev/kodari/superpowers/client/CompanionClient.java
package dev.kodari.superpowers.client;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager;
import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
import net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper;
import io.wispforest.owo.ui.hud.Hud;
import io.wispforest.owo.ui.component.LabelComponent;
import io.wispforest.owo.ui.component.UIComponents;
import io.wispforest.owo.ui.core.Positioning;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import org.lwjgl.glfw.GLFW;

public final class CompanionClient implements ClientModInitializer {
    private static final KeyBinding.Category CATEGORY = KeyBinding.Category.create(Identifier.of("superpowers_companion", "abilities"));
    private static final KeyBinding[] KEYS = {
            new KeyBinding("key.superpowers_companion.primary", GLFW.GLFW_KEY_R, CATEGORY),
            new KeyBinding("key.superpowers_companion.secondary", GLFW.GLFW_KEY_F, CATEGORY),
            new KeyBinding("key.superpowers_companion.ultimate", GLFW.GLFW_KEY_G, CATEGORY),
            new KeyBinding("key.superpowers_companion.transform", GLFW.GLFW_KEY_H, CATEGORY)
    };
    private static final KeyBinding PUSH_TO_TALK = new KeyBinding("key.superpowers_companion.push_to_talk", GLFW.GLFW_KEY_V, CATEGORY);
    static final VoiceService VOICE = new VoiceService();
    private static LabelComponent indicator;

    @Override
    public void onInitializeClient() {
        for (KeyBinding key : KEYS) KeyBindingHelper.registerKeyBinding(key);
        KeyBindingHelper.registerKeyBinding(PUSH_TO_TALK);
        Hud.add(Identifier.of("superpowers_companion", "microphone"), () -> {
            indicator = UIComponents.label(Text.literal("MIC OFF"));
            indicator.positioning(Positioning.relative(0, 0));
            return indicator;
        });
        ClientPlayConnectionEvents.DISCONNECT.register((handler, client) -> VOICE.stop());
        ClientLifecycleEvents.CLIENT_STOPPING.register(client -> VOICE.stop());
        ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) ->
                dispatcher.register(ClientCommandManager.literal("superpower")
                        .then(ClientCommandManager.literal("voice").executes(context -> {
                            MinecraftClient.getInstance().setScreen(new VoiceScreen());
                            return 1;
                        }))));
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            VOICE.setPushToTalk(PUSH_TO_TALK.isPressed());
            if (indicator != null) {
                String status = VOICE.isCapturing() ? "MIC LIVE" : "MIC OFF";
                if (!indicator.text().getString().equals(status)) indicator.text(Text.literal(status));
            }
            for (KeyBinding key : KEYS) {
                while (key.wasPressed()) {
                    // No server protocol has been agreed; never send speculative actions.
                }
            }
        });
    }
}