Disc Cord

make me a anchor macro

Kodari AI
KodariYesterday at 7:05 pm 1
AnchorMacro
A Minecraft plugin that allows players to create and manage anchor-based macro systems. Players can set anchor points at specific locations and bind command sequences or actions to them. The plugin provides a GUI menu for configuring anchors, setting activation triggers, and managing macro execution. Supports multiple anchor types including teleport anchors, command anchors, and redstone-triggered anchors. Includes permission-based access control, cooldown management, and visual particle effects to mark anchor locations. Players can save, load, and share anchor configurations through a simple command interface.

An anchor macro needs a client-side Fabric mod; this project is a server plugin. Kodari supports Fabric for Minecraft 26.3, 26.2, 1.21.11, 1.21.4, 1.20.4, 1.19.4, and 1.18.2. Which version do you want?

Disc Cord

Undetectable Anchor Macro for Minecraft PvP

Kodari AI
KodariYesterday at 7:06 pm 1

An anchor macro needs a client-side mod; this project is a server plugin. Kodari supports Fabric for Minecraft 26.3, 26.2, 1.21.11, 1.21.4, 1.20.4, 1.19.4, and 1.18.2. Which version do you want?

I can’t guarantee a macro will be undetectable by servers or anti-cheat systems.

Disc Cord

1.21.11

Kodari AI
KodariYesterday at 7:06 pm 1

This project is a server plugin. Kodari supports Fabric mods for Minecraft 1.21.11.

Switch to Fabric 1.21.11

Disc Cord

MAKE IT SO I CAN PUT IT IN MODRINTH

Kodari AI
KodariYesterday at 7:11 pm 3
  • Add a configurable keybind to place, charge, and activate a respawn anchor.

  • Package it as a client-side Fabric mod JAR suitable for a Modrinth profile. Anti-cheat detection can’t be guaranteed.

Created the Fabric 1.21.11 anchor macro. Press R while aiming at a block or an existing anchor; press it again to cancel. Keep an anchor and glowstone in your hotbar, and keep aiming at the anchor as it charges.

For Modrinth, compile and download the JAR, then add it to a Fabric 1.21.11 profile with Fabric API installed. Anti-cheat detection cannot be guaranteed.

Disc Cord

put it as z

Kodari AI
KodariYesterday at 7:13 pm 1

Changed the default keybind to Z. If you’ve already used the mod, change it in Minecraft’s Controls settings too; your saved keybind may override the new default.

Disc Cord

make it to where it charges the anchor with glow and it sets it off

Kodari AI
KodariYesterday at 7:14 pm 1

The macro already does this: press Z while aiming at an anchor to charge it with glowstone, then activate it. Keep glowstone in your hotbar, avoid holding it in your offhand, and keep aiming at the anchor.

It explodes in the Overworld and End; in the Nether, it sets your respawn point instead.

Disc Cord

mAKE IT AUTO PLACE ACNHOR

Kodari AI
KodariYesterday at 7:16 pm 1

The macro already auto-places an anchor: put an anchor and glowstone in your hotbar, aim at the face of a block, and press Z. Keep aiming at the placed anchor so it can charge and activate it.

Disc Cord

AND AUTO CHARGE AND SET IT OFF TO EXPLAODE

Kodari AI
KodariYesterday at 7:16 pm 1

Press Z once while aiming at a block: the macro places an anchor, charges it with glowstone, and activates it.

Keep an anchor and glowstone in your hotbar, and keep aiming at the placed anchor. It explodes in the Overworld or End, not the Nether.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 206
src/client/java/dev/kodari/anchormacro/AnchorMacroClient.java
package dev.kodari.anchormacro;

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.minecraft.block.Blocks;
import net.minecraft.block.RespawnAnchorBlock;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;
import net.minecraft.util.math.BlockPos;
import org.lwjgl.glfw.GLFW;

public final class AnchorMacroClient implements ClientModInitializer {
    private static final KeyBinding ACTIVATE = KeyBindingHelper.registerKeyBinding(new KeyBinding(
            "key.anchormacro.activate", GLFW.GLFW_KEY_Z,
            KeyBinding.Category.create(Identifier.of("anchormacro", "general"))));

    private BlockPos target;
    private int originalSlot;
    private int ticksRemaining;
    private int delay;

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(this::tick);
    }

    private void tick(MinecraftClient client) {
        while (ACTIVATE.wasPressed()) {
            if (target != null) {
                finish(client);
            } else {
                start(client);
            }
        }

        if (target == null) return;
        if (client.player == null || client.world == null || client.interactionManager == null) {
            target = null;
            return;
        }
        if (--ticksRemaining <= 0) {
            finish(client);
            return;
        }
        if (delay > 0) {
            delay--;
            return;
        }
        if (!(client.crosshairTarget instanceof BlockHitResult hit)
                || hit.getType() != HitResult.Type.BLOCK || !hit.getBlockPos().equals(target)
                || !client.world.getBlockState(target).isOf(Blocks.RESPAWN_ANCHOR)) return;

        PlayerInventory inventory = client.player.getInventory();
        if (client.world.getBlockState(target).get(RespawnAnchorBlock.CHARGES) == 0) {
            int glowstone = find(inventory, Items.GLOWSTONE);
            if (glowstone < 0) {
                finish(client);
                return;
            }
            inventory.setSelectedSlot(glowstone);
            client.interactionManager.interactBlock(client.player, Hand.MAIN_HAND, hit);
            delay = 3;
        } else {
            int slot = originalSlot;
            if (inventory.getStack(slot).isOf(Items.GLOWSTONE)) {
                for (int i = 0; i < 9; i++) {
                    if (!inventory.getStack(i).isOf(Items.GLOWSTONE)) {
                        slot = i;
                        break;
                    }
                }
            }
            if (!inventory.getStack(slot).isOf(Items.GLOWSTONE)) {
                inventory.setSelectedSlot(slot);
                client.interactionManager.interactBlock(client.player, Hand.MAIN_HAND, hit);
            }
            finish(client);
        }
    }

    private void start(MinecraftClient client) {
        if (client.player == null || client.world == null || client.interactionManager == null
                || client.currentScreen != null || !(client.crosshairTarget instanceof BlockHitResult hit)
                || hit.getType() != HitResult.Type.BLOCK) return;

        PlayerInventory inventory = client.player.getInventory();
        if (find(inventory, Items.GLOWSTONE) < 0) return;
        originalSlot = inventory.getSelectedSlot();
        if (client.world.getBlockState(hit.getBlockPos()).isOf(Blocks.RESPAWN_ANCHOR)) {
            target = hit.getBlockPos();
        } else {
            int anchor = find(inventory, Items.RESPAWN_ANCHOR);
            if (anchor < 0) return;
            target = hit.getBlockPos().offset(hit.getSide());
            inventory.setSelectedSlot(anchor);
            client.interactionManager.interactBlock(client.player, Hand.MAIN_HAND, hit);
        }
        ticksRemaining = 60;
        delay = 2;
    }

    private static int find(PlayerInventory inventory, Item item) {
        for (int i = 0; i < 9; i++) {
            if (inventory.getStack(i).isOf(item)) return i;
        }
        return -1;
    }

    private void finish(MinecraftClient client) {
        if (client.player != null) client.player.getInventory().setSelectedSlot(originalSlot);
        target = null;
    }
}