Тимур

Create a Minecraft Java Fabric mod called EmeraldShop.

Minecraft version: 26.3 Beta.

Create a fully functional emerald shop.

FEATURES:

Add the /shop command.

Open a custom Minecraft inventory GUI.

Use emeralds as the only currency.

Add categories for weapons, armor, tools, blocks, food and resources.

Automatically load available survival items from Minecraft registries.

Add item search.

Give every item a configurable emerald price.

When a player purchases an item, remove emeralds and give the item to their inventory.

Show an error when the player does not have enough emeralds.

Perform all purchases safely on the server.

Create clean Java code, all required project files and dependencies.

IMPORTANT:

This must be a real Fabric mod, not a plugin.

Do not create a visual-only interface.

Use real Minecraft items.

Compile the project and fix all errors.

Generate a downloadable working JAR.

Kodari AI
KodariNov 1 at 10:59 am 5
EmeraldShop
EmeraldShop is a Fabric mod for Minecraft that adds a comprehensive /shop command, opening a custom GUI where players can browse and purchase survival items using emeralds as the sole currency. It features categorized tabs for weapons, armor, tools, blocks, food, and resources, automatically loading all available items from Minecraft registries. The mod includes a search bar for quick item lookup, configurable emerald pricing per item via a JSON config file, and safe server-side transaction handling. When purchasing, it validates the player's emerald balance, deducts the cost, and delivers the item to their inventory, displaying clear error messages for insufficient funds.
  1. Set up the Fabric 26.3 mod and register /shop.

  2. Build an owo-ui shop with categories, registry-backed search, and server-provided prices.

  3. Load configurable emerald prices and validate every purchase on the server.

Created the Fabric 26.3 mod with /shop, an owo-ui shop with categories, search, and pagination, and server-validated emerald purchases. The catalog is generated from survival-facing creative-tab items. Prices default to 1 emerald; the mod creates config/emeraldshop.properties on first start, where you can set a default and per-item overrides such as minecraft:diamond=32.

No custom items are added: players use vanilla emeralds, obtainable through normal survival play, to buy the listed items. Install the mod on both client and server.

To build and download the JAR in Kodari:

  1. Click Compile in the top bar (on phone: ⋮ → Compile Project).

  2. Click Compile in the window.

  3. When it succeeds, click Download on the build.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
manifest.kod
settings.gradle
Code
10 598
src/client/java/com/emeraldshop/client/EmeraldShopClient.java
package com.emeraldshop.client;

import com.emeraldshop.ShopPayloads.CatalogPayload;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;

public final class EmeraldShopClient implements ClientModInitializer {
    @Override
    public void onInitializeClient() {
        ClientPlayNetworking.registerGlobalReceiver(CatalogPayload.TYPE, (payload, context) ->
                context.client().gui.setScreen(new ShopScreen(payload.data()))
        );
    }
}