Create a client-side Fabric mod for Minecraft 26.3 that lets the player inspect shulker boxes, other containers, and command blocks, including in WorldGuard-protected areas when the server legitimately sends or allows the relevant data. Provide an intuitive inspection UI and controls, and explain usage in a README. Where the server permits opening and moving items, support normal item removal via vanilla server-authorized interactions; do not claim to bypass WorldGuard or server permissions. Make clear in the UI/README that server-protected inventories and command block contents cannot be accessed if the server does not send or authorize that information, and handle unavailable data gracefully. Implement feature code only.

Kodari AI
KodariNov 6 at 3:29 pm 2
ContainerInspector
A client-side Fabric mod for Minecraft 26.3 that allows players to inspect shulker boxes, containers, and command blocks through an intuitive UI. The mod displays inventory contents and command block data when the server legitimately sends the information, working even in WorldGuard-protected areas where data is visible. It supports vanilla server-authorized item removal when permitted, and gracefully handles unavailable data with clear messaging. The UI clearly indicates when server protection prevents access, ensuring players understand that server-protected inventories cannot be accessed without authorization. Includes comprehensive README documentation explaining usage, limitations, and server permission considerations.
  1. Set up the Fabric 26.3 client mod and an inspection keybind.

  2. Add an owo-ui panel for locally available container data, with graceful unavailable-data handling and a normal server-authorized open action.

  3. Document controls and server-side access limits in the README.

Created the client-side Fabric 26.3 inspector. Press I while looking at a block to view container slots or command-block text already available on the client. Use block normally invokes Minecraft’s ordinary main-hand interaction; if the server permits access, its vanilla screen can handle item movement.

The README explains controls and the access limits: the mod does not bypass WorldGuard or server permissions, request hidden data, or prove an inventory is empty when its preview is missing or empty.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
README.md
settings.gradle
Code
9 323
src/client/java/com/kodari/serverawareinspector/client/ContainerInspectorClient.java
package com.kodari.serverawareinspector.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.client.Minecraft;
import net.minecraft.core.BlockPos;
import net.minecraft.world.Container;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.CommandBlockEntity;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.BlockHitResult;

import java.util.ArrayList;
import java.util.List;

public final class ContainerInspectorClient implements ClientModInitializer {
    private static KeyMapping inspectKey;

    @Override
    public void onInitializeClient() {
        inspectKey = KeyMappingHelper.registerKeyMapping(
                new KeyMapping("key.serverawareinspector.inspect", InputConstants.Type.KEYBOARD,
                        InputConstants.KEY_I, KeyMapping.Category.MISC)
        );

        ClientTickEvents.END_CLIENT_TICK.register(client -> {
            while (inspectKey.consumeClick()) {
                this.inspectTarget(client);
            }
        });
    }

    private void inspectTarget(Minecraft client) {
        if (client.player == null || client.level == null) {
            return;
        }

        if (!(client.hitResult instanceof BlockHitResult hit)) {
            client.gui.setScreen(new BlockInspectorScreen(null, false, false, List.of(), null));
            return;
        }

        BlockPos position = hit.getBlockPos();
        BlockEntity blockEntity = client.level.getBlockEntity(position);
        var block = client.level.getBlockState(position).getBlock();
        boolean commandBlock = block == Blocks.COMMAND_BLOCK
                || block == Blocks.REPEATING_COMMAND_BLOCK
                || block == Blocks.CHAIN_COMMAND_BLOCK;

        List<ItemStack> contents = List.of();
        boolean containerDataAvailable = false;
        if (blockEntity instanceof Container container) {
            containerDataAvailable = true;
            List<ItemStack> visibleSlots = new ArrayList<>(container.getContainerSize());
            for (int slot = 0; slot < container.getContainerSize(); slot++) {
                visibleSlots.add(container.getItem(slot));
            }
            contents = List.copyOf(visibleSlots);
        }

        String command = blockEntity instanceof CommandBlockEntity commandEntity
                ? commandEntity.getCommandBlock().getCommand()
                : null;

        client.gui.setScreen(new BlockInspectorScreen(hit, commandBlock, containerDataAvailable, contents, command));
    }
}