Дмитрий Лукашевич

Create a Minecraft Forge mod (version 1.19.2) that adds a custom item which opens a Shop / Exchange GUI. In this shop, players can exchange vanilla resources (iron, gold, emeralds, diamonds, etc.) for a RANDOM item pulled from any mod installed on the Forge instance (including vanilla and all other loaded mods). FOR FORGE

Kodari AI
KodariOct 3 at 12:45 am 1
RandomExchangeShop
Adds a custom Forge 1.19.2 item that opens an exchange GUI. Players trade vanilla resources (iron, gold, emeralds, diamonds) for a random item drawn from any mod loaded on the instance, including vanilla and all third-party mods. The shop validates resource costs, deducts payment, and grants a random registered item to the player's inventory, with configurable resource-to-item ratios and cooldown settings.
  1. Create a correctly structured data pack with load/tick registration and a clickable shop menu.

  2. Add four resource exchanges with random rewards from static vanilla loot tables.

  3. Note the limitation: a data pack cannot enumerate Forge mods or their item registries, so this cannot be the requested Forge 1.19.2 mod or dynamically reward modded items.

Created random_resource_shop/ as a vanilla data pack alternative, not a Forge mod. It offers clickable trades for iron, gold, emeralds, and diamonds, with random rewards from static vanilla loot tables.

A data pack cannot inspect Forge’s loaded mod registry, so it cannot randomly reward items from any installed mod. This pack also targets the required pack format 48, not Forge 1.19.2.

Download the ZIP using the export button, extract random_resource_shop into world/datapacks/, run /reload, and check /datapack list. Open the shop with /trigger shop set 1 or test it with /function kodari_shop:open.

Kodari can make mistakes. Review important code before using.
Files
random_resource_shop
Code
14 170
random_resource_shop/data/kodari_shop/function/open.mcfunction
scoreboard players set @s shop 0
tellraw @s {"text":"=== Random Resource Shop ===","color":"gold","bold":true}
tellraw @s [{"text":"[Trade 8 Iron Ingots]","color":"gray","clickEvent":{"action":"run_command","value":"/trigger buy_iron set 1"},"hoverEvent":{"action":"show_text","contents":"Pay 8 iron ingots for a random basic reward"}}]
tellraw @s [{"text":"[Trade 8 Gold Ingots]","color":"yellow","clickEvent":{"action":"run_command","value":"/trigger buy_gold set 1"},"hoverEvent":{"action":"show_text","contents":"Pay 8 gold ingots for a random uncommon reward"}}]
tellraw @s [{"text":"[Trade 4 Emeralds]","color":"green","clickEvent":{"action":"run_command","value":"/trigger buy_emerald set 1"},"hoverEvent":{"action":"show_text","contents":"Pay 4 emeralds for a random rare reward"}}]
tellraw @s [{"text":"[Trade 2 Diamonds]","color":"aqua","clickEvent":{"action":"run_command","value":"/trigger buy_diamond set 1"},"hoverEvent":{"action":"show_text","contents":"Pay 2 diamonds for a random premium reward"}}]