DummyLowElo

Also make it Anticheat proof specifically Intave, Polar and Grim

📎 1 file 2,150 chars
📄
pasted-code-1792477848075.txt
txt 22 lines
▶
Create a client-side Minecraft utility mod for Fabric 1.21+ that automates Mace attribute swapping (also known as sword-swapping or ghost-swapping) to optimize PvP mechanics. 

Please build the mod autonomously according to the following strict specifications:

1. CORE MECHANIC (Tick-Perfect Swap Loop):
- The mod must intercept when the player inputs a Left-Click (Attack) while holding a Sword or an Axe in their main hand.
- In the exact same game tick (or within milliseconds), execute this precise packet sequence to the server:
  a. Scan the player's hotbar to find a Mace (prioritizing one with Density or Breach enchantments).
  b. Send a server-bound packet ('ServerboundSetCarriedItemPacket') to switch the active slot to the Mace.
  c. Send the attack packet ('ServerboundInteractPacket' or player attack swing execution) so the server registers the hit using the Mace's attributes and enchantments.
  d. Instantly send a packet to switch the active slot back to the original weapon (the Sword or Axe).

2. ANTI-CHEAT MITIGATION & SAFETY:
- To prevent immediate flagging by server-side anti-cheat plugins (like GrimAC or Vulcan), include a configurable delay buffer (in milliseconds) between the swap packets rather than forcing them into a literal hard-coded 0-millisecond execution if needed. 

3. CONFIGURATION & CONTROLS:
- Create a keybinding (register a KeyMapping, defaulting to the 'G' key) that lets the player toggle this automated swap mechanic ON and OFF. 
- Display a small text notification on the action bar (e.g., "Mace Swap: ENABLED" or "Mace Swap: DISABLED") whenever the keybind is pressed.
- Include a simple config file (JSON format preferred) where the user can adjust the packet delay (in ms) and choose which weapon types trigger the swap loop.

4. AUTOMATED BUILD:
Please structure the full project architecture with proper Fabric Mixins, compile using Gradle, and ensure all Yarn/Mojang mappings are correctly utilized for 1.21+. If you hit any Gradle compilation or dependency errors during the build, read your own logs and fix them automatically until you can successfully export the clean, working .jar file.
Kodari AI
KodariOct 20 at 6:36 am 1
MaceSwapAutomation
A client-side Fabric mod for Minecraft 1.21+ that automates Mace attribute swapping during PvP. Intercepts left-click attacks while holding a sword or axe, then within the same tick sends server-bound packets to switch to a mace (prioritizing Density/Breach enchants), executes the attack, and instantly swaps back. Features configurable packet delay buffer for anti-cheat mitigation against GrimAC and Polar, a toggleable keybinding defaulting to G, action bar notifications, and a JSON config file for adjusting delays and trigger weapon types. Built with Mixins and Yarn mappings.

I can’t build automated mace swapping or tune it to bypass Intave, Polar, or Grim. I can build a fair-play alternative: a G-key toggle that reports when you attack while a mace is in your hotbar, without changing slots, sending extra packets, or automating attacks.

  1. Set up a Fabric 26.2 client mod project.

  2. Add the toggle and an action-bar reminder using the verified 26.2 APIs.

  3. Keep it informational only—no anti-cheat evasion or combat automation.

Created a Fabric 26.2 client mod with G to toggle a reminder. When enabled, attacking with a sword or axe reports whether a mace is in your hotbar; it never swaps items or alters attack packets. I can’t provide anti-cheat evasion for Intave, Polar, or Grim.

To compile and download the jar: click Compile in the desktop top bar (or ⋮ → Compile Project on phone), click Compile in the window, then Download after it succeeds.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 143
src/client/java/com/kodari/macescout/client/MaceScoutClient.java
package com.kodari.macescout.client;

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.Holder;
import net.minecraft.tags.ItemTags;
import net.minecraft.network.chat.Component;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.AxeItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import org.lwjgl.glfw.GLFW;

public class MaceScoutClient implements ClientModInitializer {
	private static final KeyMapping TOGGLE_KEY = KeyMappingHelper.registerKeyMapping(
			new KeyMapping("key.macescout.toggle", GLFW.GLFW_KEY_G, KeyMapping.Category.MISC)
	);
	private static boolean enabled = true;
	private static boolean attackWasDown;

	@Override
	public void onInitializeClient() {
		ClientTickEvents.END_CLIENT_TICK.register(MaceScoutClient::onClientTick);
	}

	private static void onClientTick(Minecraft client) {
		Player player = client.player;
		if (player == null) {
			attackWasDown = false;
			return;
		}

		if (TOGGLE_KEY.consumeClick()) {
			enabled = !enabled;
			player.sendOverlayMessage(Component.literal("Mace reminder: " + (enabled ? "ENABLED" : "DISABLED")));
		}

		boolean attackDown = client.options.keyAttack.isDown();
		if (enabled && attackDown && !attackWasDown && isSwordOrAxe(player.getMainHandItem())) {
			player.sendOverlayMessage(Component.literal(hasMaceInHotbar(player.getInventory())
					? "Mace in hotbar — swap manually."
					: "No mace in hotbar."));
		}
		attackWasDown = attackDown;
	}

	private static boolean isSwordOrAxe(ItemStack stack) {
		Item item = stack.getItem();
		return item instanceof AxeItem || stack.is((Holder<Item> holder) -> holder.is(ItemTags.SWORDS));
	}

	private static boolean hasMaceInHotbar(Inventory inventory) {
		for (int slot = 0; slot < 9; slot++) {
			if (inventory.getItem(slot).is(Items.MACE)) {
				return true;
			}
		}
		return false;
	}
}