Rex

Create a Fabric mod for Minecraft 1.21.11 that implements a block visibility feature. The mod should allow players to see through blocks based on the world seed, enhancing the exploration experience. Include customizable keys for toggling the visibility on and off, and a clean GUI for user interaction. The mod should be easy to use and integrate seamlessly with the game. The visibility functionality should be toggled by and also we make a place in gui where we can paste the seed plus key customizion and block selection so that block doesn't turn transparent blocks like diamond and gold and etc etc all block that are available make sure that block selected block won't turn transparent and non selected do turn transparent

Kodari AI
KodariOct 3 at 2:34 pm 5
SeedVision
A Fabric mod for Minecraft 1.21.11 that enables players to see through blocks based on the world seed. Features a clean GUI for pasting custom seeds, customizing toggle keys, and selecting specific blocks that remain opaque. Non-selected blocks become transparent, enhancing exploration while preserving valuable resources like diamond and gold. Seamless integration with existing game mechanics.
  1. Add client-side controls for toggling visibility and opening settings, with editable key assignments.

  2. Add a settings screen for a seed value and an all-block whitelist that keeps selected blocks opaque.

  3. Implement selective transparent rendering and package the mod’s client resources and metadata.

Created the Block Veil Fabric 1.21.11 client mod with a YACL settings screen and searchable, paginated selection of registered blocks. Selected blocks stay opaque; other model blocks render translucently.

  • X toggles visibility; O opens settings by default. Both keys are customizable in the block-selection screen.

  • The optional seed field restricts visibility to the matching world; leave it blank to allow any world.

  • Ore blocks, including diamond, gold, iron, and ancient debris, are opaque by default.

  • Added the Gradle project, Fabric metadata, mixins, resources, and YACL bundle manifest.

The seed check uses the seed hash available to the client; it does not reveal the server’s actual seed.

Rex

Create a Fabric mod for Minecraft 1.21.11 that implements a block visibility feature. The mod should allow players to see through blocks based on the world seed, enhancing the exploration experience. Include customizable keys for toggling the visibility on and off, and a clean GUI for user interaction. The mod should be easy to use and integrate seamlessly with the game. The visibility functionality should be toggled by and also we make a place in gui where we can paste the seed plus key customizion and block selection so that block doesn't turn transparent blocks like diamond and gold and etc etc all block that are available make sure that block selected block won't turn transparent and non selected do turn transparent

Kodari AI
KodariOct 3 at 2:36 pm 1
  1. Check the existing mod files against the requested behavior and project setup.

  2. Fix any gaps in seed matching, key bindings, block selection, or rendering.

  3. Verify the 1.21.11 API signatures touched by any code changes, then patch.

The existing Block Veil project already implements the requested feature:

  • X toggles visibility; O opens settings, and both keys are customizable.

  • The settings screen lets you enter a seed and search/select registered blocks to keep opaque. Other model blocks become translucent while visibility is enabled.

  • Ore blocks are opaque by default, and settings persist in config/blockveil.properties.

  • The mod is configured for Fabric 1.21.11 and includes its YACL dependency manifest.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
14 678
src/client/java/dev/kodari/blockveil/BlockVeilClient.java
package dev.kodari.blockveil;

import dev.isxander.yacl3.api.ButtonOption;
import dev.isxander.yacl3.api.ConfigCategory;
import dev.isxander.yacl3.api.Option;
import dev.isxander.yacl3.api.OptionDescription;
import dev.isxander.yacl3.api.OptionGroup;
import dev.isxander.yacl3.api.YetAnotherConfigLib;
import dev.isxander.yacl3.api.controller.StringControllerBuilder;
import dev.isxander.yacl3.api.controller.TickBoxControllerBuilder;
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.client.MinecraftClient;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.util.InputUtil;
import net.minecraft.util.Identifier;
import net.minecraft.world.biome.source.BiomeAccess;
import dev.kodari.blockveil.mixin.BiomeAccessAccessor;
import org.lwjgl.glfw.GLFW;

public final class BlockVeilClient implements ClientModInitializer {
    public static final String MOD_ID = "blockveil";
    public static final VisibilityConfig CONFIG = new VisibilityConfig();

    private static final KeyBinding.Category KEY_CATEGORY = KeyBinding.Category.create(Identifier.of(MOD_ID, "controls"));
    public static KeyBinding TOGGLE_KEY;
    public static KeyBinding SETTINGS_KEY;
    private static volatile boolean renderActive;

    @Override
    public void onInitializeClient() {
        CONFIG.load();
        TOGGLE_KEY = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.blockveil.toggle_visibility", CONFIG.toggleKeyCode, KEY_CATEGORY));
        SETTINGS_KEY = KeyBindingHelper.registerKeyBinding(new KeyBinding(
                "key.blockveil.open_settings", CONFIG.settingsKeyCode, KEY_CATEGORY));

        ClientTickEvents.END_CLIENT_TICK.register(BlockVeilClient::tick);
    }

    public static boolean isXrayActive() {
        return renderActive;
    }

    public static void refreshRendering(MinecraftClient client) {
        renderActive = shouldBeActive(client);
        if (client.world != null) {
            client.worldRenderer.reload();
        }
    }

    private static void tick(MinecraftClient client) {
        boolean activeBeforeTick = renderActive;
        renderActive = shouldBeActive(client);
        if (activeBeforeTick != renderActive && client.world != null) {
            client.worldRenderer.reload();
        }

        if (TOGGLE_KEY.wasPressed()) {
            CONFIG.enabled = !CONFIG.enabled;
            CONFIG.save();
            refreshRendering(client);
        }

        if (SETTINGS_KEY.wasPressed()) {
            client.setScreen(createSettingsScreen(client, null));
        }
    }

    private static boolean shouldBeActive(MinecraftClient client) {
        if (!CONFIG.enabled) {
            return false;
        }

        String seedText = CONFIG.seed.trim();
        if (seedText.isEmpty()) {
            return true;
        }
        if (client.world == null) {
            return false;
        }

        try {
            long expectedSeed = BiomeAccess.hashSeed(Long.parseLong(seedText));
            long worldSeed = ((BiomeAccessAccessor) (Object) client.world.getBiomeAccess()).blockveil$getSeed();
            return expectedSeed == worldSeed;
        } catch (NumberFormatException exception) {
            return false;
        }
    }

    private static Screen createSettingsScreen(MinecraftClient client, Screen parent) {
        return YetAnotherConfigLib.createBuilder()
                .title(net.minecraft.text.Text.literal("Block Veil Settings"))
                .category(ConfigCategory.createBuilder()
                        .name(net.minecraft.text.Text.literal("Visibility"))
                        .group(OptionGroup.createBuilder()
                                .name(net.minecraft.text.Text.literal("World and controls"))
                                .option(Option.<Boolean>createBuilder()
                                        .name(net.minecraft.text.Text.literal("Enable Block Veil"))
                                        .description(OptionDescription.of(net.minecraft.text.Text.literal(
                                                "Show non-selected blocks translucently. The visibility key also toggles this.")))
                                        .binding(CONFIG.enabled, () -> CONFIG.enabled, value -> {
                                            if (CONFIG.enabled != value) {
                                                CONFIG.enabled = value;
                                                CONFIG.save();
                                                refreshRendering(client);
                                            }
                                        })
                                        .controller(TickBoxControllerBuilder::create)
                                        .build())
                                .option(Option.<String>createBuilder()
                                        .name(net.minecraft.text.Text.literal("World seed (optional)"))
                                        .description(OptionDescription.of(net.minecraft.text.Text.literal(
                                                "Only activate in the matching world. Leave blank for any world.")))
                                        .binding(CONFIG.seed, () -> CONFIG.seed, value -> {
                                            if (!CONFIG.seed.equals(value)) {
                                                CONFIG.seed = value;
                                                CONFIG.save();
                                                refreshRendering(client);
                                            }
                                        })
                                        .controller(StringControllerBuilder::create)
                                        .build())
                                .option(ButtonOption.createBuilder()
                                        .name(net.minecraft.text.Text.literal("Choose opaque blocks and keys"))
                                        .description(OptionDescription.of(net.minecraft.text.Text.literal(
                                                "Select blocks that stay opaque and customize both key bindings.")))
                                        .action((screen, buttonOption) -> client.setScreen(new BlockSelectionScreen(screen)))
                                        .build())
                                .build())
                        .build())
                .build()
                .generateScreen(parent);
    }
}