ATOKHENSEM

mod that can auto click the ominous vault to get mace core

Kodari AI
KodariNov 8 at 6:06 am 3
OminousVaultAutoClicker
Automates clicking the ominous vault in Minecraft to efficiently obtain mace cores. The mod continuously interacts with the vault block when detected, simulating player clicks at optimal intervals. Features include configurable click delay, toggle keybind, and visual feedback via status messages. Automatically targets the nearest ominous vault within range, prioritizing mace core collection. Includes cooldown management to prevent server-side rate limiting and respects game rules. Works seamlessly in survival and creative modes, with a simple configuration file for adjusting behavior.
  • Add a toggleable client-side vault clicker that uses an ominous trial key in either hand.

  • Keep vault rewards and server-side rules unchanged.

Added the ominous vault clicker. Press V to toggle it, hold an ominous trial key, and aim at an ominous vault.

The mod uses normal vault interactions: it can’t guarantee a heavy core or reopen a vault you’ve already looted. Obtain keys from ominous trial spawners; find heavy cores in ominous vaults.

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

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.network.chat.Component;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.VaultBlock;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;
import org.lwjgl.glfw.GLFW;

public class VaultClickerClient implements ClientModInitializer {
    private boolean enabled;
    private int cooldown;

    @Override
    public void onInitializeClient() {
        KeyMapping toggle = KeyMappingHelper.registerKeyMapping(new KeyMapping(
                "key.vaultclicker.toggle", InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_V, KeyMapping.Category.MISC));

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (toggle.consumeClick()) {
                enabled = !enabled;
                cooldown = 0;
                if (client.player != null) {
                    client.player.sendOverlayMessage(Component.literal("Ominous vault clicker: " + (enabled ? "ON" : "OFF")));
                }
            }

            if (!enabled || client.player == null || client.level == null || client.gameMode == null || client.gui.screen() != null) {
                return;
            }
            if (cooldown > 0) {
                cooldown--;
                return;
            }
            if (!(client.hitResult instanceof BlockHitResult hit) || hit.getType() != HitResult.Type.BLOCK) {
                return;
            }
            var state = client.level.getBlockState(hit.getBlockPos());
            if (state.getBlock() != Blocks.VAULT || !state.getValue(VaultBlock.OMINOUS)) {
                return;
            }
            for (InteractionHand hand : InteractionHand.values()) {
                if (client.player.getItemInHand(hand).getItem() == Items.OMINOUS_TRIAL_KEY) {
                    client.gameMode.useItemOn(client.player, hand, hit);
                    cooldown = 10;
                    break;
                }
            }
        });
    }
}