playboi disco

Build me a mod by holding a trial key in my hand and while I look at a vault that I click automatically when an ominous bottle is in the vault so that I can get it very easily

Kodari AI
KodariOct 16 at 2:36 pm 2
OminousVaultAutoCollector
Hold a trial key and look at a vault. When an ominous bottle is detected inside the vault, the mod automatically clicks the vault to retrieve the bottle instantly. The mod continuously scans the targeted vault's inventory, triggering an automatic interaction the moment an ominous bottle appears, eliminating manual clicking and making collection effortless. Designed for Fabric 1.26.2, the mod activates only when the player holds the trial key, ensuring no accidental interactions occur during normal gameplay.

Created Vault Bottle Clicker. While holding a Trial Key and aiming at a vault, it automatically uses the key once when the vault’s displayed item is an Ominous Bottle. It won’t repeatedly click while you keep aiming at the same vault.

playboi disco

its not 100% that i get the bottle can u change that if needed read the games code so you can predict the bottles spawn

Kodari AI
KodariOct 16 at 2:45 pm 1

I checked the vault code: the item shown before opening is a random preview, not a promise of what you’ll get. When the key is used, the vault rolls its actual rewards separately, so the mod can’t predict or guarantee an Ominous Bottle from that preview. Changing when it clicks won’t make it 100%.

I haven’t changed the mod, because a client-side change can’t guarantee the reward. To guarantee bottles, the mod would need to change the vault’s server-side loot—which would alter vault rewards, rather than predict them.

playboi disco

but can you just make it so i have higher percantages to get the bottle

Kodari AI
KodariOct 16 at 3:02 pm 3
  • Check the current clicker and the vault’s actual reward table.

  • If the reward system allows it, raise the Ominous Bottle odds in the server-side vault rewards.

Raised the Ominous Bottle odds for Ominous Vault rewards: each ominous common reward roll now gets an extra 1-in-5 chance to add a bottle, alongside the vanilla drop chance. The bonus bottle keeps the usual count and amplifier.

It applies in single-player; for multiplayer, the server must also have the mod installed.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 148
src/main/java/com/kodari/vaultbottleclicker/VaultBottleClicker.java
package com.kodari.vaultbottleclicker;

import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.loot.v3.LootTableEvents;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
import net.minecraft.world.level.storage.loot.LootPool;
import net.minecraft.world.level.storage.loot.entries.EmptyLootItem;
import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction;
import net.minecraft.world.level.storage.loot.functions.SetOminousBottleAmplifierFunction;
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;
import net.minecraft.world.level.storage.loot.providers.number.UniformGenerator;

public class VaultBottleClicker implements ModInitializer {
    @Override
    public void onInitialize() {
        LootTableEvents.MODIFY.register((key, tableBuilder, source, registries) -> {
            if (!key.equals(BuiltInLootTables.TRIAL_CHAMBERS_REWARD_OMINOUS_COMMON)) {
                return;
            }

            tableBuilder.withPool(
                LootPool.lootPool()
                    .setRolls(ConstantValue.exactly(1.0F))
                    .add(
                        LootItem.lootTableItem(Items.OMINOUS_BOTTLE)
                            .setWeight(1)
                            .apply(SetItemCountFunction.setCount(ConstantValue.exactly(1.0F)))
                            .apply(SetOminousBottleAmplifierFunction.setAmplifier(UniformGenerator.between(2.0F, 4.0F)))
                    )
                    .add(EmptyLootItem.emptyItem().setWeight(4))
            );
        });
    }
}