Gamer Sky

26.3 side-clint auto attribute swap 4 option "lunge swap", "breach swap-1", "breach swap-2", "shilddisebleswap"

Kodari AI
KodariNov 5 at 8:09 am 1
AttributeSwapSystem
A Fabric mod for Minecraft 1.26.3 that implements automatic attribute swapping on the client side. The mod provides four configurable swap options: "lunge swap" for lunging attacks, "breach swap-1" and "breach swap-2" for two different breach scenarios, and "shield disable swap" that automatically swaps attributes when a shield is disabled. Each option can be toggled independently, allowing players to customize their attribute loadouts for specific combat situations. The mod monitors player actions and states, then instantly applies the appropriate attribute configuration without manual switching.

What should each option swap from and to, and what should trigger it?

For example, should “lunge swap” select a weapon with Lunge when you attack, then switch back? Please also explain the difference between “breach swap-1” and “breach swap-2.”

Gamer Sky

fabric mod 26.3

Kodari AI
KodariNov 5 at 8:10 am 1

This will be a client-side Fabric 26.3 mod. What should trigger each swap, and which item or enchantment should it select? In particular, how should breach swap-1 and breach swap-2 differ?

Gamer Sky

what is error

Kodari AI
KodariNov 5 at 8:11 am 1

Please paste the error message or a screenshot and say when it appears—during compilation, launch, or gameplay.

Gamer Sky
Kodari AI
KodariNov 5 at 8:12 am 1

The error means the project is missing the files required to compile a Fabric mod. It’s empty because the swap behavior hasn’t been specified yet.

Tell me what should trigger each swap and what items it should switch between, especially how breach swap-1 and breach swap-2 differ. Then I can create the mod files.

Gamer Sky

breach swap 1 is sward breach mace and return back sward breach swap 2 is axe density mace and windcharg

Kodari AI
KodariNov 5 at 8:14 am 1

For breach swap-1, I understand: sword → Breach mace → sword.

For breach swap-2, should it switch axe → Density mace → wind charge, or use the wind charge and then return to the axe?

Also, what should trigger each sequence, and how should lunge swap and shield disable swap work?

Gamer Sky

lunge swap is selected slot to lunge spear and return back to selected slot and shield disable swap is sward axe and return back to sward and ones more add name is "stun slam"

Kodari AI
KodariNov 5 at 8:20 am 1

What should trigger each swap—an attack, a keybind, or something else?

Also, what sequence should stun slam perform? For breach swap-2, should it use the wind charge and then return to the axe?

Gamer Sky

stun slam is a lightweight client-side Fabric mod that automates the axe → mace "stun slam" combo in Minecraft PvP

Kodari AI
KodariNov 5 at 8:26 am 2

Stun Slam can perform the axe → mace combo. Before I build it, I need two details:

  1. Should each combo start when you attack, or should each have its own keybind?

  2. For breach swap-2, should it use the wind charge after the mace, then return to the axe?

Gamer Sky

1 yes and 2 windcharge axe then mace

Kodari AI
KodariNov 5 at 8:30 am 1

For breach swap-2, I have wind charge → axe → Density mace.

For the trigger, “yes” could mean either option I offered: should the combos start automatically when you attack, or should each have its own keybind?

Gamer Sky

yes and keybind is F6

Kodari AI
KodariNov 5 at 8:32 am 1

I’ll use F6 for the keybind. Should it cycle through the five options, with the selected combo starting automatically when you attack?

For stun slam, should it return to the original slot after using the mace?

Gamer Sky

keybind yes stun slam return to windcharge after using the mace

Kodari AI
KodariNov 5 at 8:44 am 4

I’ll use F6 to cycle the five modes; attacking will start the selected combo. Stun Slam will return to the wind charge after the mace attack.

Created the client-side Fabric mod. Press F6 to cycle through Off and the five combo modes; attack to trigger the selected mode.

Keep the required weapons and wind charges in your hotbar. Combos use normal server combat rules, so timing and results can vary by server.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
8 266
src/client/java/com/kodari/stunslam/StunSlamClient.java
package com.kodari.stunslam;

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.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.core.component.DataComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.tags.ItemTags;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.component.PiercingWeapon;
import net.minecraft.world.item.enchantment.Enchantments;

public final class StunSlamClient implements ClientModInitializer {
    private static final String[] MODES = {"Off", "Lunge Swap", "Breach Swap-1", "Breach Swap-2", "Shield Disable Swap", "Stun Slam"};
    private static int mode;
    private static Entity target;
    private static int nextSlot = -1;
    private static int returnSlot = -1;
    private static int activeSlot = -1;
    private static int delay;

    @Override
    public void onInitializeClient() {
        KeyMapping cycle = KeyMappingHelper.registerKeyMapping(new KeyMapping(
                "key.stun_slam.cycle", InputConstants.KEY_F6, KeyMapping.Category.MISC));
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (cycle.consumeClick()) {
                cancel(client);
                mode = (mode + 1) % MODES.length;
                if (client.player != null) {
                    client.player.sendOverlayMessage(Component.literal("Stun Slam: " + MODES[mode]));
                }
            }
            tick(client);
        });
    }

    public static boolean startCombo(Minecraft client) {
        if (mode == 0 || client.player == null || client.gameMode == null || client.level == null
                || client.gui.screen() != null || client.gameMode.isSpectator()) {
            return false;
        }
        if (nextSlot >= 0) return true;
        Inventory inventory = client.player.getInventory();
        int selected = inventory.getSelectedSlot();
        int sword = find(inventory, 0);
        int axe = find(inventory, 1);
        int breach = find(inventory, 2);
        int density = find(inventory, 3);
        int spear = find(inventory, 4);
        int wind = find(inventory, 5);

        if (mode == 1) {
            if (spear < 0) return false;
            ItemStack stack = inventory.getItem(spear);
            PiercingWeapon weapon = stack.get(DataComponents.PIERCING_WEAPON);
            if (weapon == null) return false;
            inventory.setSelectedSlot(spear);
            client.gameMode.piercingAttack(stack.getAttackAnimation(), weapon);
            inventory.setSelectedSlot(selected);
            return true;
        }

        Entity victim = client.crosshairPickEntity;
        if (victim == null || !victim.isAlive()) return false;
        int first;
        int second;
        int restore;
        if (mode == 2) {
            if (sword < 0 || breach < 0 || selected != sword) return false;
            first = sword; second = breach; restore = sword;
        } else if (mode == 3) {
            if (wind < 0 || axe < 0 || density < 0) return false;
            inventory.setSelectedSlot(wind);
            client.gameMode.useItem(client.player, InteractionHand.MAIN_HAND);
            first = axe; second = density; restore = wind;
        } else if (mode == 4) {
            if (sword < 0 || axe < 0 || selected != sword) return false;
            first = axe; second = -1; restore = sword;
        } else {
            if (wind < 0 || axe < 0 || density < 0) return false;
            first = axe; second = density; restore = wind;
        }

        inventory.setSelectedSlot(first);
        client.gameMode.attack(client.player, victim);
        client.player.swing(InteractionHand.MAIN_HAND, inventory.getItem(first).getAttackAnimation(), true);
        if (second < 0) {
            inventory.setSelectedSlot(restore);
        } else {
            target = victim;
            nextSlot = second;
            returnSlot = restore;
            activeSlot = first;
            delay = 10;
        }
        return true;
    }

    private static void tick(Minecraft client) {
        if (nextSlot < 0) return;
        if (client.player == null || client.gameMode == null || client.level == null) {
            clear();
            return;
        }
        Inventory inventory = client.player.getInventory();
        if (client.gui.screen() != null || inventory.getSelectedSlot() != activeSlot
                || target == null || !target.isAlive() || client.player.distanceTo(target) > 3.0F) {
            cancel(client);
            return;
        }
        if (--delay > 0) return;
        inventory.setSelectedSlot(nextSlot);
        client.gameMode.attack(client.player, target);
        client.player.swing(InteractionHand.MAIN_HAND, inventory.getItem(nextSlot).getAttackAnimation(), true);
        inventory.setSelectedSlot(returnSlot);
        clear();
    }

    private static void cancel(Minecraft client) {
        if (nextSlot >= 0 && client.player != null
                && client.player.getInventory().getSelectedSlot() == activeSlot) {
            client.player.getInventory().setSelectedSlot(returnSlot);
        }
        clear();
    }

    private static void clear() {
        target = null;
        nextSlot = -1;
        returnSlot = -1;
        activeSlot = -1;
        delay = 0;
    }

    private static int find(Inventory inventory, int kind) {
        for (int slot = 0; slot < 9; slot++) {
            ItemStack stack = inventory.getItem(slot);
            boolean matches = switch (kind) {
                case 0 -> stack.is(holder -> holder.is(ItemTags.SWORDS));
                case 1 -> stack.is(holder -> holder.is(ItemTags.AXES));
                case 2 -> stack.getItem() == Items.MACE && stack.getEnchantments().entrySet().stream()
                        .anyMatch(entry -> entry.getKey().is(Enchantments.BREACH));
                case 3 -> stack.getItem() == Items.MACE && stack.getEnchantments().entrySet().stream()
                        .anyMatch(entry -> entry.getKey().is(Enchantments.DENSITY));
                case 4 -> stack.is(holder -> holder.is(ItemTags.SPEARS)) && stack.getEnchantments().entrySet().stream()
                        .anyMatch(entry -> entry.getKey().is(Enchantments.LUNGE));
                case 5 -> stack.getItem() == Items.WIND_CHARGE;
                default -> false;
            };
            if (matches) return slot;
        }
        return -1;
    }
}