lucen4ikovi4123

Create a Fabric client-side mod for Minecraft Java 26.3 named Auto Vault Opener.

Add a toggle keybind: V. When enabled, check the block under the player crosshair. If it is a Vault or Ominous Vault within normal interaction reach, and the player holds the correct key in the main hand, automatically use/right-click that vault once.

Use Trial Key for a normal Vault. Use Ominous Trial Key for an Ominous Vault. Add a 500 ms delay between interaction attempts. Stop interacting immediately if the player looks away, moves out of reach, opens any screen or GUI, dies, has no correct key, or after a successful vault opening.

Show “Auto Vault: ON” and “Auto Vault: OFF” in chat when toggled. Add no other functions: no auto attack, PvP, player targeting, movement, inventory actions, item pickup, commands, blocks, items, or server-side code. The mod must be client-side only and intended for single-player use.

Kodari AI
KodariOct 8 at 12:10 am 2
AutoVaultOpener
Client-side Fabric mod for Minecraft 26.3 that adds a V keybind toggle. When enabled, automatically uses Vaults and Ominous Vaults within interaction reach by right-clicking once, requiring the correct Trial Key or Ominous Trial Key in hand. Features a 500ms interaction delay, immediate cancellation on looking away, moving out of reach, opening any GUI, dying, lacking the correct key, or after successful opening. Displays "Auto Vault: ON/OFF" in chat on toggle. Client-side only, single-player focused, no other functionality.
  1. Set up the 26.3 client-only Fabric project and a V toggle.

  2. Check the crosshair target, key, and normal Vault type; attempt interaction no more than every 500 ms and stop after success or any interruption.

  3. Add the toggle’s ON/OFF chat messages.

Created Auto Vault Opener as a client-only Fabric 26.3 mod for single-player.

  • Press V to toggle it; chat displays “Auto Vault: ON” or “Auto Vault: OFF.”

  • It checks the block under the crosshair, normal interaction reach, and the main-hand key. It uses a Trial Key on a normal Vault and an Ominous Trial Key on an Ominous Vault, with at least 500 ms between attempts.

  • It pauses when the player is out of reach, looks away, opens a screen, dies, or lacks the correct key. It stops after detecting the Vault enter its opening state.

No new items or blocks are added; the mod uses vanilla Trial Keys and Vaults.

lucen4ikovi4123

Change the Auto Vault Opener behavior.

Do NOT automatically open a Vault or Ominous Vault just because the player is looking at it with a key.

Only work with Ominous Vault blocks. While the player is looking directly at an Ominous Vault within normal reach and holding an Ominous Trial Key in the main hand, detect the item currently displayed inside the vault's spinning preview.

If the displayed preview item is exactly a Minecraft Mace, automatically perform one right-click/use interaction on that Ominous Vault.

If the preview item is not a Mace, do nothing and wait. Check again every client tick or frequently enough to catch the item when it changes.

Use a short 100 ms cooldown only after a click. Stop immediately if the player looks away, moves out of reach, opens a GUI, dies, no longer holds an Ominous Trial Key, or the vault has opened.

Do not interact with normal Vaults or any other blocks, entities, items, inventories, combat, movement, PvP, or commands. This is a client-side Fabric mod for Minecraft Java 26.3.

Kodari AI
KodariOct 8 at 12:19 am 2

Updated Auto Vault Opener to ignore normal Vaults and monitor only Ominous Vaults. It uses the main-hand Ominous Trial Key only when the displayed preview is a Mace, with a 100 ms cooldown after each interaction. It pauses when the player looks away, leaves reach, opens a GUI, dies, or no longer holds the key, and stops once the vault begins opening. The V toggle and ON/OFF chat messages remain.

lucen4ikovi4123

The mod loads but does not detect the Mace preview inside an Ominous Vault.

Fix the preview detection using the client-side block entity data and the vault's displayed item, not an inventory check and not a raycast to an item entity. The preview item is rendered inside the Ominous Vault and is not a dropped item or player inventory item.

Add debug chat messages when Auto Vault is ON: "Target: Ominous Vault" "Key: detected" or "Key: missing" "Preview item: <item id>" "Preview is mace: true/false" "Right-click sent"

Only right-click once when the displayed item id equals minecraft:mace. Keep the mod Fabric client-side for Minecraft Java 26.3.

Kodari AI
KodariOct 8 at 12:29 am 1
  1. Trace the existing preview check and find the Ominous Vault’s client-side displayed-item data.

  2. Replace the detection, add the requested ON-state debug messages, and verify the Fabric 26.3 APIs used.

Fixed preview detection to read the Ominous Vault’s client-side block entity sharedData.displayItem and compare its registry ID to minecraft:mace. It now sends one right-click per observed Mace preview, with the 100 ms cooldown, and won’t repeat while that same preview remains displayed.

The requested debug messages appear in chat while enabled; target, key, and preview status messages are emitted when their values change to avoid flooding chat.

lucen4ikovi4123

Change the target preview item from Minecraft Mace to Heavy Core.

Only right-click the targeted Ominous Vault when the currently displayed preview item is exactly minecraft:heavy_core.

Do not right-click when the preview item is minecraft:mace or any other item.

Keep all other behavior unchanged: Fabric 26.3, client-side only, require an Ominous Trial Key in the main hand, require the player to be looking directly at an Ominous Vault within reach, and send exactly one right-click when minecraft:heavy_core is detected.

Update the debug messages to:

Preview item: <item id> Preview is heavy core: true/false Right-click sent for heavy core

Kodari AI
KodariOct 8 at 12:34 am 1

Changed preview matching to exactly minecraft:heavy_core. Mace and all other preview items are ignored. The right-click debug message is now “Right-click sent for heavy core,” and the preview status reads “Preview is heavy core: true/false.” All other behavior is unchanged.

lucen4ikovi4123

The Heavy Core preview appears only for a very short time, so the current mod reacts too slowly.

Optimize the detection for speed. Check the targeted Ominous Vault preview item every client tick, with no timer and no debounce before detection.

The moment the displayed preview item becomes exactly minecraft:heavy_core, immediately send the right-click/use packet in the same client tick or the earliest possible tick. Do not wait 100 ms or 500 ms before the first click.

Keep a cooldown only AFTER a click is sent, to prevent repeated clicks. Use a 1000 ms cooldown after sending the right-click.

Pre-cache the item reference for minecraft:heavy_core when the client starts. Do not create new objects, search registries, print debug chat messages, or do expensive work every tick. Debug messages must be disabled by default because chat output can slow the tick loop.

The mod must only interact when I am directly targeting an Ominous Vault within reach and holding an Ominous Trial Key in the main hand. Client-side Fabric 26.3.

Kodari AI
KodariOct 8 at 12:40 am 1

Updated the client tick check to compare the vault’s displayed item directly against a Heavy Core reference cached at client initialization. It sends the right-click as soon as a matching preview is detected, then applies a 1000 ms cooldown. Removed per-tick registry lookups and debug chat output; toggle messages remain.

lucen4ikovi4123

The latest version is broken. It sends a right-click at random times and does not reliably wait for minecraft:heavy_core. Fix this before optimizing speed.

The interaction must be gated by a real boolean condition: target is an Ominous Vault AND player holds minecraft:ominous_trial_key in main hand AND detected displayed preview ItemStack is exactly minecraft:heavy_core AND clickSent is false.

Never send a use/right-click packet unless all four conditions are true.

Restore lightweight debug output, but do not print every tick. Print only when a value changes:

Auto Vault: ON/OFF Target: Ominous Vault / no vault Key: detected / missing Preview item changed: <item id> Heavy core detected: true/false Right-click sent for heavy core

Add an on-screen HUD instead of repeated chat messages:

Target: <value> Key: <value> Preview: <item id> Heavy Core: true/false Status: waiting / clicked

Do not use a timer to trigger clicks. The timer may only block repeated clicks AFTER a successful click. Build and test the updated Fabric 26.3 JAR.

Kodari AI
KodariOct 8 at 12:57 am 2

Fixed the click gate: it now sends a right-click only when the crosshair targets an in-reach Ominous Vault, the main hand holds an Ominous Trial Key, the displayed preview is the cached Heavy Core item, and clickSent is false. The one-second cooldown starts only after an interaction is sent; the latch prevents repeats while those conditions remain true.

Added change-only debug chat messages and the requested HUD. Item ID lookup happens only when the preview item changes.

To build and test the JAR in Kodari, click Compile in the desktop top bar (or ⋮ → Compile Project on phone), then click Compile in the window. If it succeeds, use Download on that build.

lucen4ikovi4123

Make it exactly like the Auto Vault mod (https://modrinth.com/mod/auto-vault?version=26.1.2&loader=fabric), but for Fabric Java 26.3.

Kodari AI
KodariOct 8 at 4:01 am 4
  1. Check the linked mod’s documented behavior and options.

  2. Compare it with this project, then implement the matching behavior for Fabric 26.3.

Adapted the client mod to match the linked Auto Vault feature set: G toggles auto-opening and K opens configuration. It supports normal and Ominous Vaults with their matching main-hand keys, configurable preview-item filtering (Trident, Mace, Heavy Core, Enchanted Book, and custom item IDs), and optional Wind Burst verification for books. The focused Vault’s preview name appears above the hotbar; settings save to config/autovault.json.

lucen4ikovi4123
📎 1 file 1,054 chars
📄
pasted-code-1791432558644.txt
txt 18 lines
▶
Create a new original client-side Fabric mod for Minecraft Java 26.3 inspired by the public behavior of the Auto Vault mod for Fabric 26.1.2.

Do not copy or decompile Auto Vault. Implement it from scratch.

The mod should automatically interact with a Vault or Ominous Vault only when I am looking directly at it within normal reach and holding the matching key in my main hand.

For normal Vault require minecraft:trial_key.
For Ominous Vault require minecraft:ominous_trial_key.

Add a V key toggle, a safe 500 ms interaction cooldown, simple settings, and a HUD showing:
Auto Vault ON/OFF
Target vault type
Key detected yes/no
Status waiting/clicked

Add an optional Ominous Vault filter for minecraft:heavy_core. When this filter is enabled, interact only when the Heavy Core is detected as the displayed vault item. When disabled, open any valid Ominous Vault.

Do not add combat, PvP, movement, inventory automation, commands, blocks, items, or server-side features. Build and test a Fabric Java 26.3 JAR and provide the download.
Kodari AI
KodariOct 8 at 4:28 am 2
  1. Implement the attached spec in the existing client mod.

  2. Build and verify the Fabric 26.3 JAR.

Updated the client mod to match the attached spec: V toggles Auto Vault, and K opens settings for the optional Ominous Vault Heavy Core filter. It targets only in-reach Vault blocks, requires the matching key in the main hand, and applies a 500 ms cooldown after an interaction is accepted. The HUD shows ON/OFF, target type, key status, and waiting/clicked status.

To build and download the JAR, click Compile in the desktop top bar (or ⋮ → Compile Project on phone), then click Compile in the window. When it succeeds, click Download on that build.

lucen4ikovi4123

Bug: the mod clicked an Ominous Vault even though Heavy Core was not displayed. The Heavy Core filter is not being enforced.

When Heavy Core Filter is enabled, the code must never send a right-click/use packet unless the detected displayed preview item is exactly minecraft:heavy_core.

Remove any fallback behavior that opens Ominous Vaults when the preview is unknown, null, empty, or cannot be read. Unknown preview must always mean WAIT, never click.

Use this exact condition before every interaction: if (heavyCoreFilterEnabled && !previewItemId.equals("minecraft:heavy_core")) { status = "waiting for heavy core"; return; }

Do not send a click based only on target vault type, key presence, cooldown, or a timer. The Heavy Core condition must be required when the filter is enabled.

Show the current filter state and preview item on HUD:

Heavy Core filter: ON/OFF Preview item: <item id or unknown> Status: waiting for heavy core / clicked

Kodari AI
KodariOct 8 at 4:37 am 1

Fixed the Heavy Core filter gate. When enabled for an Ominous Vault, an unknown or non-Heavy-Core preview now sets the status to waiting for heavy core and returns before the only use-item call. The HUD shows the filter state and current preview ID; preview IDs are updated only when the displayed item changes.

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

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.fabricmc.fabric.api.client.rendering.v1.hud.HudElementRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.hud.VanillaHudElements;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.Identifier;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.VaultBlock;
import net.minecraft.world.level.block.entity.vault.VaultBlockEntity;
import net.minecraft.world.level.block.entity.vault.VaultState;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;

public final class AutoVaultOpenerClient implements ClientModInitializer {
	private static final long CLICK_COOLDOWN_NANOS = 500_000_000L;
	private static final Identifier HUD_ID = Identifier.fromNamespaceAndPath("auto_vault_opener", "status");
	private static final KeyMapping TOGGLE_KEY = KeyMappingHelper.registerKeyMapping(
			new KeyMapping("key.auto_vault_opener.toggle", InputConstants.KEY_V, KeyMapping.Category.MISC)
	);
	private static final KeyMapping CONFIG_KEY = KeyMappingHelper.registerKeyMapping(
			new KeyMapping("key.auto_vault_opener.config", InputConstants.KEY_K, KeyMapping.Category.MISC)
	);

	private static AutoVaultConfig config;
	private static boolean enabled;
	private static long lastClickNanos;
	private static String targetType = "No vault";
	private static boolean keyDetected;
	private static Item previewItem;
	private static String previewItemId = "unknown";
	private static String status = "waiting";

	@Override
	public void onInitializeClient() {
		config = AutoVaultConfig.load();
		ClientTickEvents.END_CLIENT_TICK.register(AutoVaultOpenerClient::onClientTick);
		HudElementRegistry.attachElementAfter(
				VanillaHudElements.HOTBAR,
				HUD_ID,
				(graphics, deltaTracker) -> {
					Minecraft client = Minecraft.getInstance();
					if (client.player != null && client.level != null && client.gui.screen() == null) {
						graphics.text(client.font, Component.literal("Auto Vault: " + (enabled ? "ON" : "OFF")), 8, 8, 0xFFFFFFFF);
						graphics.text(client.font, Component.literal("Target: " + targetType), 8, 20, 0xFFFFFFFF);
						graphics.text(client.font, Component.literal("Key detected: " + (keyDetected ? "yes" : "no")), 8, 32, 0xFFFFFFFF);
							graphics.text(client.font, Component.literal("Heavy Core filter: " + (config.ominousHeavyCoreFilter ? "ON" : "OFF")), 8, 44, 0xFFFFFFFF);
							graphics.text(client.font, Component.literal("Preview item: " + previewItemId), 8, 56, 0xFFFFFFFF);
							graphics.text(client.font, Component.literal("Status: " + status), 8, 68, 0xFFFFFFFF);
					}
				}
		);
	}

	private static void onClientTick(Minecraft client) {
		status = "waiting";
		while (TOGGLE_KEY.consumeClick()) {
			if (client.gui.screen() == null) {
				enabled = !enabled;
			}
		}

		while (CONFIG_KEY.consumeClick()) {
			if (client.gui.screen() == null) {
				client.gui.setScreen(new AutoVaultConfigScreen(config));
			}
		}

		if (client.player == null || client.level == null || client.gui.screen() != null) {
			targetType = "No vault";
			keyDetected = false;
			updatePreviewItem(null);
			return;
		}

		if (!(client.hitResult instanceof BlockHitResult targetHit)
				|| !client.player.isWithinBlockInteractionRange(targetHit.getBlockPos(), 0.0)) {
			targetType = "No vault";
			keyDetected = false;
			updatePreviewItem(null);
			return;
		}

		BlockState targetState = client.level.getBlockState(targetHit.getBlockPos());
		if (targetState.getBlock() != Blocks.VAULT) {
			targetType = "No vault";
			keyDetected = false;
			updatePreviewItem(null);
			return;
		}

		boolean ominous = targetState.getValue(VaultBlock.OMINOUS);
		targetType = ominous ? "Ominous Vault" : "Vault";
		if (client.level.getBlockEntity(targetHit.getBlockPos()) instanceof VaultBlockEntity vaultEntity) {
			ItemStack displayedItem = vaultEntity.getSharedData().getDisplayItem();
			updatePreviewItem(displayedItem.isEmpty() ? null : displayedItem.getItem());
		} else {
			updatePreviewItem(null);
		}
		ItemStack mainHand = client.player.getMainHandItem();
		keyDetected = mainHand.getItem() == (ominous ? Items.OMINOUS_TRIAL_KEY : Items.TRIAL_KEY);
		boolean heavyCoreFilterEnabled = ominous && config.ominousHeavyCoreFilter;
		if (heavyCoreFilterEnabled && !previewItemId.equals("minecraft:heavy_core")) {
			status = "waiting for heavy core";
			return;
		}

		if (!enabled || !client.player.isAlive() || !keyDetected || client.gameMode == null
				|| targetState.getValue(VaultBlock.STATE) != VaultState.ACTIVE) {
			return;
		}

		long now = System.nanoTime();
		if (lastClickNanos != 0L && now - lastClickNanos < CLICK_COOLDOWN_NANOS) {
			status = "clicked";
			return;
		}

		if (client.gameMode.useItemOn(client.player, InteractionHand.MAIN_HAND, targetHit).consumesAction()) {
			lastClickNanos = now;
			status = "clicked";
		}
	}

	private static void updatePreviewItem(Item item) {
		if (previewItem == item) {
			return;
		}

		previewItem = item;
		Identifier itemId = item == null ? null : BuiltInRegistries.ITEM.getKey(item);
		previewItemId = itemId == null ? "unknown" : itemId.toString();
	}
}