HomeJavaModsItemMarket
ItemMarket
ModsJava

ItemMarket

by tntnetta · on Modrinth

Mod that adds a GUI for buying and selling items. | Mod que agrega una GUI para compra y venta de artículos. Free Minecraft Java mod for 1.20.1.

⬇ Download on Modrinth

ItemMarket — In‑Game Item Buy/Sell Market (Fabric)

EN
ItemMarket adds a simple, fast in‑game market GUI where players can buy and sell items using a built‑in coin balance saved per-world. Prices are fully configurable via easy JSON files, and the mod exposes a small Java/Fabric API so other mods can read/write player balances and listen to market transactions.

Credits: Developed by TNTStudios — Website: TNTStudios.space — Socials: @TNTStudiosn


Features

EN


Requirements

EN

If you only install it on the server, players won’t have the GUI/keybind and won’t be able to use the market.


Installation

EN

  1. Install Fabric Loader and Fabric API for your Minecraft version.
  2. Drop the ItemMarket .jar into:
    • Client: mods/
    • Server: mods/
  3. Launch the game/server once to generate the config folders.

How to Use (Players)

EN

  1. Join the world/server.
  2. Press M to open the market.
    • You can rebind the key in Options → Controls (search for “ItemMarket”).
  3. Choose:
    • Buy (green) — buy items using your coins
    • Sell (gold) — sell items from your inventory
  4. Scroll the item list and click an item:
    • Buy: confirm to purchase 1
    • Sell: choose Sell 1 or Sell All
  5. Your balance is shown at the top-right of the screen.

What happens when you buy?

EN

What happens when you sell?

EN


Economy System (How coins are saved)

EN


Price Configuration (JSON)

ItemMarket reads prices from:

config/ItemMarket/compra/
config/ItemMarket/venta/

EN

File naming rule

EN Each .json filename must be a number, and that number is the price.

Examples:

If the filename is not purely numeric, it will be skipped.

Important: price 0 is valid as a filename (0.json) but will not work in-game because transactions require price > 0. Use 1+.

JSON format

EN Each file is a JSON array of item IDs (strings):

[
  "minecraft:diamond",
  "minecraft:emerald",
  "minecraft:iron_ingot"
]

Buy configuration example

EN Create:

config/ItemMarket/compra/250.json

[
  "minecraft:diamond",
  "minecraft:netherite_ingot"
]

Result:

Sell configuration example

EN Create:

config/ItemMarket/venta/50.json

[
  "minecraft:iron_ingot",
  "minecraft:gold_ingot"
]

Result:

What if an item appears in multiple files?

EN Each item can only have one price in memory (maps overwrite by item). If you put the same item in multiple price files, whichever file is loaded last will win — file ordering may depend on the OS, so don’t rely on it. Keep your lists unique per folder.

What if an item ID is wrong or the mod is missing?

EN

Do I need to restart to apply changes?

EN Yes. Prices are loaded at startup by MarketConfig.init(). There is no built-in live reload command yet, so you should:


Developer API (Java/Fabric API)

ItemMarket provides a Java API intended for other Fabric mods.

EN This is not an HTTP/REST API. You “connect” by adding ItemMarket as a dependency and calling its classes.

API: Read/Write balance

Class: com.TNTStudios.itemmarket.api.ItemMarketAPI

Methods:

EN (Example: Give coins on player join)

import com.TNTStudios.itemmarket.api.ItemMarketAPI;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;

public class MyMod {
    public static void init() {
        ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> {
            var player = handler.getPlayer();
            // Give 100 coins on first join (simple example)
            ItemMarketAPI.addBalance(player, 100);
        });
    }
}

Notes (EN)

Event: Transaction callback

Interface: com.TNTStudios.itemmarket.api.MarketTransactionCallback

Called only when a transaction succeeds.

Signature:

void onTransaction(ServerPlayerEntity player, Item item, int count, long totalPrice, boolean isBuy);

EN (Example: Log every transaction)

import com.TNTStudios.itemmarket.api.MarketTransactionCallback;

public class MyMod {
    public static void init() {
        MarketTransactionCallback.EVENT.register((player, item, count, totalPrice, isBuy) -> {
            String type = isBuy ? "BUY" : "SELL";
            System.out.println("[MyMod] " + player.getName().getString() +
                " " + type + " " + count + "x " + item.getName().getString() +
                " for " + totalPrice + " coins");
        });
    }
}

Networking & Security (How it works internally)

EN

EN The server is authoritative, so clients cannot “fake” prices or balances via packets.


Troubleshooting

EN Market doesn’t open (pressing M does nothing)

Items show but can’t buy/sell

Some items missing


Credits & Links

EN



ItemMarket — Mercado In‑Game para Comprar/Vender Ítems (Fabric)

ES
ItemMarket agrega un mercado simple y rápido con GUI dentro del juego para que los jugadores puedan comprar y vender ítems usando un balance de monedas guardado por mundo. Los precios se configuran con archivos JSON muy fáciles, y el mod incluye una API Java/Fabric para que otros mods puedan leer/escribir balances y escuchar transacciones.

Créditos: Desarrollado por TNTStudios — Sitio web: TNTStudios.space — Redes: @TNTStudiosn


Características

ES


Requisitos

ES

Si lo instalas solo en el servidor, los jugadores no tendrán la GUI/tecla y no podrán usar el mercado.


Instalación

ES

  1. Instala Fabric Loader y Fabric API para tu versión de Minecraft.
  2. Coloca el .jar de ItemMarket en:
    • Cliente: mods/
    • Servidor: mods/
  3. Inicia el juego/servidor una vez para que se creen las carpetas de configuración.

Cómo usarlo (Jugadores)

ES

  1. Entra al mundo/servidor.
  2. Presiona M para abrir el mercado.
    • Puedes cambiar la tecla en Opciones → Controles (busca “ItemMarket”).
  3. Elige:
    • Comprar (verde) — compras usando tus monedas
    • Vender (dorado) — vendes ítems del inventario
  4. Desplázate por la lista y haz clic en un ítem:
    • Comprar: confirmar para comprar 1
    • Vender: elegir Vender 1 o Vender todo
  5. Tu balance aparece arriba a la derecha.

¿Qué pasa al comprar?

ES

¿Qué pasa al vender?

ES


Economía (Cómo se guardan las monedas)

ES


Configuración de Precios (JSON)

ItemMarket lee precios desde:

config/ItemMarket/compra/
config/ItemMarket/venta/

ES

Regla de nombres de archivo

ES Cada .json debe llamarse con un número, y ese número es el precio.

Ejemplos:

Si el nombre no es 100% numérico, se ignora.

Importante: 0.json existe, pero no funcionará en juego porque las transacciones requieren price > 0. Usa 1+.

Formato del JSON

ES Cada archivo es un arreglo JSON de IDs de ítems (strings):

[
  "minecraft:diamond",
  "minecraft:emerald",
  "minecraft:iron_ingot"
]

Ejemplo de compra

ES Crear:

config/ItemMarket/compra/250.json

[
  "minecraft:diamond",
  "minecraft:netherite_ingot"
]

Resultado:

Ejemplo de venta

ES Crear:

config/ItemMarket/venta/50.json

[
  "minecraft:iron_ingot",
  "minecraft:gold_ingot"
]

Resultado:

¿Qué pasa si un ítem está en varios archivos?

ES Cada ítem solo puede tener un precio en memoria (los mapas sobreescriben por ítem). Si repites un ítem en varios archivos, “gana” el último que se cargue — el orden puede variar por sistema operativo. Mejor no repetir ítems.

¿Y si el ID está mal o falta un mod?

ES

¿Debo reiniciar para aplicar cambios?

ES Sí. Los precios se cargan al iniciar con MarketConfig.init(). No hay recarga en vivo por comando (todavía), así que:


API para Desarrolladores (Java/Fabric)

ItemMarket incluye una API Java para otros mods Fabric.

ES Esto no es una API HTTP/REST. Te “conectas” agregando ItemMarket como dependencia y llamando sus clases.

API: Leer/Escribir balance

Clase: com.TNTStudios.itemmarket.api.ItemMarketAPI

Métodos:

ES (Ejemplo: dar monedas al entrar)

import com.TNTStudios.itemmarket.api.ItemMarketAPI;
import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;

public class MiMod {
    public static void init() {
        ServerPlayConnectionEvents.JOIN.register((handler, sender, server) -> {
            var player = handler.getPlayer();
            ItemMarketAPI.addBalance(player, 100);
        });
    }
}

Notas (ES)

Evento: Callback de transacción

Interfaz: com.TNTStudios.itemmarket.api.MarketTransactionCallback

Se llama solo si la transacción fue exitosa.

Firma:

void onTransaction(ServerPlayerEntity player, Item item, int count, long totalPrice, boolean isBuy);

ES (Ejemplo: registrar transacciones en consola)

import com.TNTStudios.itemmarket.api.MarketTransactionCallback;

public class MiMod {
    public static void init() {
        MarketTransactionCallback.EVENT.register((player, item, count, totalPrice, isBuy) -> {
            String tipo = isBuy ? "COMPRA" : "VENTA";
            System.out.println("[MiMod] " + player.getName().getString() +
                " " + tipo + " " + count + "x " + item.getName().getString() +
                " por " + totalPrice + " monedas");
        });
    }
}

Red & Seguridad (Cómo funciona por dentro)

ES

ES El servidor manda, así que el cliente no puede falsificar precios o balances.


Solución de problemas

ES No abre el mercado (M no hace nada)

Se ven ítems pero no deja comprar/vender

Faltan algunos ítems


Créditos & Links

ES

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more