Tomek

Create a client-side Fabric mod for Minecraft 26.3. When the player is holding an Ominous Trial Key in their main hand and looking directly at a Vault block (Ominous Vault), check the item currently displayed inside the Vault. The exact tick the displayed item becomes a Heavy Core (minecraft:heavy_core), automatically right-click (use item on) the Vault block once, then wait 20 ticks before checking again."

Kodari AI
KodariToday at 5:20 pm 2
OminousVaultAutoUnlocker
Client-side Fabric mod for Minecraft 26.3. When holding an Ominous Trial Key and looking at an Ominous Vault, monitors the displayed item inside the vault. The exact tick the displayed item becomes a Heavy Core, automatically right-clicks the Vault block once to unlock it, then waits 20 ticks before resuming checks. Provides seamless automation for unlocking Ominous Vaults without manual intervention.
  • Check the targeted ominous vault’s synchronized display item each client tick.

  • Use the main-hand key once when it shows a Heavy Core, then pause checks for 20 ticks.

Created the client-side mod. Hold an Ominous Trial Key and look at an ominous vault; it will use the key when the displayed item is a Heavy Core, then wait 20 ticks before checking again.

The trigger depends on the vault display state synchronized to your client.

Tomek

only heavy core nothing more

Kodari AI
KodariToday at 5:23 pm 1

Yes—only when the ominous vault displays a Heavy Core. No other displayed item triggers it.

Tomek

so why i got enchanted golden apple

Kodari AI
KodariToday at 5:34 pm 1

The mod uses your key only when it sees a Heavy Core in the vault’s display, but that display does not determine the reward. Minecraft rolls the actual loot separately on the server when the key is used, so you can receive an enchanted golden apple instead.

A client-side mod can’t guarantee a Heavy Core from an unmodified server’s vault.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
5 111
src/client/java/com/kodari/vaultkeytiming/VaultKeyTimingClient.java
package com.kodari.vaultkeytiming;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.VaultBlock;
import net.minecraft.world.level.block.entity.vault.VaultBlockEntity;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.HitResult;

public class VaultKeyTimingClient implements ClientModInitializer {
    private int cooldown;

    @Override
    public void onInitializeClient() {
        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            if (client.player == null || client.level == null || client.gameMode == null) {
                cooldown = 0;
                return;
            }
            if (cooldown > 0 && --cooldown > 0) {
                return;
            }
            if (client.player.getMainHandItem().getItem() != Items.OMINOUS_TRIAL_KEY
                    || !(client.hitResult instanceof BlockHitResult hit)
                    || hit.getType() != HitResult.Type.BLOCK
                    || !(client.level.getBlockEntity(hit.getBlockPos()) instanceof VaultBlockEntity vault)
                    || !client.level.getBlockState(hit.getBlockPos()).getValue(VaultBlock.OMINOUS)
                    || vault.getSharedData().getDisplayItem().getItem() != Items.HEAVY_CORE) {
                return;
            }
            client.gameMode.useItemOn(client.player, InteractionHand.MAIN_HAND, hit);
            cooldown = 20;
        });
    }
}