S

Minecraft 1.21.11 Fabric — Subtle Mace Aim Assist

Create a client-side Fabric mod for Minecraft Java Edition 1.21.11 that provides subtle, configurable aim assistance for mace PvP.

  1. Mace Detection Aim assist only activates when a mace is currently held in the player's main hand. The mace can be in any hotbar slot. The mod should be lightweight and compatible with multiplayer. 2. Target Detection Detect valid enemy players within a 15° angle from the center of the crosshair. Only assist when the player is already looking reasonably close to a target. Never snap to targets outside the 15° activation angle. Prioritize the target closest to the crosshair. Ignore the local player, spectators, and teammates where team information is available. 3. Subtle Aim Adjustment Gradually adjust the camera toward the selected target. Set the default assistance strength to 10% of the angular difference per update. Allow the strength to be configured between 1% and 15%. Never instantly snap to targets. Do not automatically aim at specific body parts. Stop adjusting when the target leaves the activation range or becomes invalid. Avoid aggressive tracking, sudden movements, and excessive camera correction. 4. Smooth Tracking Preserve normal mouse input and player control. Prevent camera jitter, oscillation, and rapid target switching. Use a short target-lock grace period to reduce flickering around the activation boundary. Do not interfere with attack timing, movement, or other combat mechanics. 5. Mod Menu Configuration

Add the following configurable settings:

Aim Assist: On/Off Activation Angle: 1°–15°, default 15° Assistance Strength: 1%–15%, default 10% Target Lock Stability: Adjustable Target Indicator: On/Off Reset to Defaults button 6. Compatibility and Delivery Minecraft Java Edition 1.21.11. Fabric Loader and compatible Fabric API. Mod Menu integration. Provide the complete source code, build files, dependencies, and installation instructions. Ensure the project compiles and test the activation angle, smoothness, and deactivation behavior.

The mod must require the player to aim toward the target manually and must not automatically search the entire screen for opponents.

Deliver a complete, buildable project with a README explaining installation and configuration.

The speed of the assist shld be customizable up to 10x the base speed/strength that iys defaulted at

Kodari AI
KodariOct 13 at 5:37 am 2
MaceAimAssist
Client-side Fabric mod for Minecraft 1.21.11 providing subtle, configurable aim assistance for mace PvP. Activates only when holding a mace and looking within a 15° cone of an enemy player. Gradually adjusts camera toward the target at a configurable strength (1-15%, default 10%, scalable up to 10x). Features smooth tracking with target-lock grace period to prevent flickering, preserves mouse input, and ignores spectators/teammates. Includes Mod Menu integration with toggles for activation angle, assistance strength, target lock stability, target indicator, and reset defaults. Requires manual aiming—never snaps or searches the screen automatically.
  1. Create a Fabric 1.21.11 client mod with smooth, manually gated mace aim assistance and stability controls.

  2. Add a YACL settings screen with Mod Menu integration and the requested speed multiplier.

  3. Add the build metadata, bundled-library manifest, and README installation/configuration guide.

Created the Fabric 1.21.11 client mod with crosshair-gated mace targeting, smooth capped corrections, target stability, an indicator, and YACL settings exposed through Mod Menu. The project includes Gradle files, bundled-library metadata, and a README with installation steps and an in-game verification checklist.

To download the compiled bundle: click Compile in Kodari’s top bar (on mobile: ⋮ → Compile Project), click Compile in the window, then click Download when it succeeds. Extract the bundle and place the mod and included library JARs in your Fabric profile’s mods folder.

I haven’t run a live Minecraft session here; the README checklist covers activation-angle boundaries, smoothness, and deactivation.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
README.md
settings.gradle
Code
10 476
src/client/java/dev/kodari/maceaimassist/client/MaceAimAssistClient.java
package dev.kodari.maceaimassist.client;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.network.ClientPlayerEntity;
import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Items;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3d;

public final class MaceAimAssistClient implements ClientModInitializer {
    public static final String MOD_ID = "maceaimassist";

    private static final double MAX_ANGLE_PER_TICK = 4.0;

    private static AbstractClientPlayerEntity lockedTarget;
    private static int switchStabilityTicks;
    private static int targetGraceTicks;
    private static boolean targetSelected;

    @Override
    public void onInitializeClient() {
        AimAssistConfig.load();
        ClientTickEvents.END_CLIENT_TICK.register(MaceAimAssistClient::onClientTick);
        HudElementRegistry.addLast(Identifier.of(MOD_ID, "aim_indicator"),
                (context, tickCounter) -> renderIndicator(context));
    }

    private static void onClientTick(MinecraftClient client) {
        ClientPlayerEntity player = client.player;
        ClientWorld world = client.world;
        targetSelected = false;

        if (player == null || world == null || !AimAssistConfig.enabled
                || !player.getMainHandStack().isOf(Items.MACE)) {
            resetTracking();
            return;
        }

        Vec3d lookDirection = player.getRotationVec(1.0f).normalize();
        Candidate bestCandidate = null;
        Candidate lockedCandidate = null;
        boolean lockedTargetStillValid = false;

        for (AbstractClientPlayerEntity target : world.getPlayers()) {
            if (!isValidTarget(player, target)) {
                continue;
            }

            if (target == lockedTarget) {
                lockedTargetStillValid = true;
            }

            Vec3d targetPoint = target.getEntityPos().add(0.0, target.getHeight() * 0.5, 0.0);
            Vec3d direction = targetPoint.subtract(player.getEyePos()).normalize();
            double dot = Math.clamp(lookDirection.dotProduct(direction), -1.0, 1.0);
            float angle = (float) Math.toDegrees(Math.acos(dot));
            if (angle > AimAssistConfig.activationAngle) {
                continue;
            }

            Candidate candidate = new Candidate(target, direction, angle);
            if (target == lockedTarget) {
                lockedCandidate = candidate;
            }
            if (bestCandidate == null || candidate.angle() < bestCandidate.angle()) {
                bestCandidate = candidate;
            }
        }

        if (lockedTarget != null && !lockedTargetStillValid) {
            lockedTarget = null;
            switchStabilityTicks = 0;
            targetGraceTicks = 0;
        }

        if (bestCandidate == null) {
            if (lockedTarget != null && ++targetGraceTicks > AimAssistConfig.targetLockStability) {
                lockedTarget = null;
                switchStabilityTicks = 0;
            }
            return;
        }

        targetGraceTicks = 0;
        Candidate selectedCandidate;
        if (lockedCandidate != null && bestCandidate.player() != lockedCandidate.player()
                && switchStabilityTicks > 0) {
            selectedCandidate = lockedCandidate;
            switchStabilityTicks--;
        } else {
            selectedCandidate = bestCandidate;
            if (selectedCandidate.player() != lockedTarget) {
                lockedTarget = selectedCandidate.player();
                switchStabilityTicks = AimAssistConfig.targetLockStability;
            } else if (bestCandidate.player() == lockedTarget) {
                switchStabilityTicks = AimAssistConfig.targetLockStability;
            }
        }

        targetSelected = true;
        adjustAim(player, selectedCandidate.direction());
    }

    private static boolean isValidTarget(PlayerEntity player, PlayerEntity target) {
        return target != player && target.isAlive() && !target.isSpectator() && !player.isTeammate(target);
    }

    private static void adjustAim(ClientPlayerEntity player, Vec3d direction) {
        double horizontalLength = Math.sqrt(direction.x * direction.x + direction.z * direction.z);
        float desiredYaw = (float) (Math.toDegrees(Math.atan2(direction.z, direction.x)) - 90.0);
        float desiredPitch = (float) -Math.toDegrees(Math.atan2(direction.y, horizontalLength));
        float yawDifference = wrapDegrees(desiredYaw - player.getYaw());
        float pitchDifference = desiredPitch - player.getPitch();

        double baseStrength = AimAssistConfig.assistanceStrength / 100.0;
        double adjustmentFraction = 1.0 - Math.pow(1.0 - baseStrength, AimAssistConfig.speedMultiplier);
        double yawAdjustment = yawDifference * adjustmentFraction;
        double pitchAdjustment = pitchDifference * adjustmentFraction;
        double stepLength = Math.sqrt(yawAdjustment * yawAdjustment + pitchAdjustment * pitchAdjustment);
        if (stepLength > MAX_ANGLE_PER_TICK) {
            double scale = MAX_ANGLE_PER_TICK / stepLength;
            yawAdjustment *= scale;
            pitchAdjustment *= scale;
        }

        player.setYaw(player.getYaw() + (float) yawAdjustment);
        player.setPitch((float) Math.clamp(player.getPitch() + pitchAdjustment, -90.0, 90.0));
    }

    private static float wrapDegrees(float angle) {
        angle %= 360.0f;
        if (angle >= 180.0f) {
            angle -= 360.0f;
        } else if (angle < -180.0f) {
            angle += 360.0f;
        }
        return angle;
    }

    private static void renderIndicator(DrawContext context) {
        MinecraftClient client = MinecraftClient.getInstance();
        if (!targetSelected || !AimAssistConfig.targetIndicator || client.player == null
                || client.world == null || !AimAssistConfig.enabled
                || !client.player.getMainHandStack().isOf(Items.MACE)) {
            return;
        }

        int x = client.getWindow().getScaledWidth() / 2 + 8;
        int y = client.getWindow().getScaledHeight() / 2 + 8;
        context.drawTextWithShadow(client.textRenderer, "•", x, y, 0xFF73DFA0);
    }

    public static void resetTracking() {
        lockedTarget = null;
        switchStabilityTicks = 0;
        targetGraceTicks = 0;
        targetSelected = false;
    }

    private record Candidate(AbstractClientPlayerEntity player, Vec3d direction, float angle) {
    }
}