Mods
Resource Packs
Data Packs
Modpacks
Shaders
Plugins
Mods Resource Packs Data Packs Plugins Shaders Modpacks
Get Modrinth App Upgrade to Modrinth+
Sign in
ModsPluginsData PacksShadersResource PacksModpacks
Sign in
Settings
Data Trader

Data Trader

A villager like entity which can be used as trader. Customizable with data packs.

3,936
5
Adventure

Compatibility

Minecraft: Java Edition

1.20.1
1.19–1.19.3
1.18.2

Platforms

Forge
NeoForge

Supported environments

Client and server

90% of ad revenue goes to creators

Support creators and Modrinth ad-free with Modrinth+

Links

Report issues View source Visit wiki Join Discord server

Creators

MelanX
MelanX Owner

Details

Licensed Apache-2.0
Published 2 years ago
Updated 12 months ago
DescriptionChangelogVersions

Porting information for 1.21 update #StandWithUkraine

Data Trader

A mod which adds a new trader to the game.

Defining the trades

File structure

The trader can receive an ID for a trader offers "recipe". This is a list of single trader offers. An example file could look like this:

{
  "Offers": [
    {
      "buy": {
        "tag": "forge:gems/diamond",
        "count": 3
      },
      "buyB": {
        "item": "minecraft:wooden_pickaxe"
      },
      "sell": {
        "item": "minecraft:diamond_pickaxe",
        "nbt": "{Damage:0,Enchantments:[{id:\"minecraft:efficiency\",lvl:2},{id:\"minecraft:unbreaking\", lvl:10}]}"
      },
      "rewardExp": false,
      "xp": 0
    }
  ]
}

This example includes only one merchant offer. The trader will sell the item in sell.

The player needs to provide the item in buy and buyB to receive the item. maxUses is the amount of times the player can use this trade before the trader needs to restock.

If rewardExp is true, the player will receive xp points for each trade, amount defined in xp.


The following values are required:
  • buy
  • sell

The default values are:

Name Default value
buyB Air
rewardExp false
xp 0

Where to put it in?

You use a data pack to provide these files. These are located at <modid>/trader_offers/. An example can be found here.

How to use?

You spawn the trader using the /summon command, or by using the spawn egg. After this, you use the command /datatrader setOffer @e <modid>:<path> to set the recipe. This can also be done by datapacks. For a normal trader, I recommend setting NoAI to true.

You can also summon a trader with a specific trading table by using the command /datatrader summon ~ ~ ~ <offer_id> <NoAI>

Setting custom skin overlay

Just put a texture to <modid>:textures/entity/trader/<offer_id path>.png. This texture should be something like the profession overlay texture, e.g. minecraft:textures/entity/villager/profession/cleric.png. You are allowed to put this mod in any modpack you like.

Modrinth is open source.

app-ads@1633f40

© Rinth, Inc.

Company

TermsPrivacyRulesCareers

Resources

SupportBlogDocsStatus

Interact

Discord X (Twitter) Mastodon Crowdin
Get Modrinth App Settings
NOT AN OFFICIAL MINECRAFT SERVICE. NOT APPROVED BY OR ASSOCIATED WITH MOJANG OR MICROSOFT.