SimpleJsonVillagerTrades

SimpleJsonVillagerTrades

About as simple as it sounds, a small jij-able library to modify/add/remove Villager trades via datapacks.

by
3.1K Downloads
fabriclibrarymanagementutility
Rent Server with this Mod

About this Mod

Simple JSON Villager Trades

As simple as it sounds, a small jij-able/standalone library to modify/add merchant trades via datapacks.

For Datapackers

You are able to modify merchant trades through JSON files the data/<namespace>/trade_offers/ directory.
For example:

{
  "__COMMENT": "This adds a ruined portal map to the Cartographer's trades.",

  "profession": "minecraft:cartographer",
  "replace": false,
  "offers": {
    "apprentice": [
      {
        "type": "minecraft:sell_map",
        "price": 5,
        "name_key": "filled_map.ruined_portal",
        "feature_tag": "minecraft:ruined_portal",
        "icon": "target_x",
        "max_uses": 10,
        "experience": 2
      }
    ]
  }
}

For more tutorials and more information on modifying merchant trades, see the wiki.

Compatibility

SJVT uses Minecraft's hardcoded trade map as a base for the datapacks to build on top of, so it should work with most mods, even those who add new villager professions.
You can also export the hardcoded map (including non-native support mods) as a datapack by running the sjvt:build command.

For Mod Developers

You can include the mod using the following repository and dependency in your build.gradle (where [TAG] is the latest version):

repositories {
  maven {
    name = "Modrinth"
    url = "https://api.modrinth.com/maven"
    content {
      includeGroup "maven.modrinth"
    }
  }
}

dependencies {
  modImplementation include("maven.modrinth:sjvt:[TAG]") //To include (jij) in your mod
  modImplementation "maven.modrinth:sjvt:[TAG]" // To require the mod to be installed seperatly
}

Custom Trade Offer Factories

To create a trade offer factory, implement the SerializableTradeOfferFactory interface.
Then register the codec to the TradeOfferFactories.TRADE_OFFER_FACTORY_REGISTRY registry.
You can also use methods and fields in the CodecHelper class to assist in the creation of codecs.

Then see 'For Datapackers'

Available Versions

Release 1.1.0release
MC 1.18.2fabric
May 4, 2022
Bug Fix 1.0.1release
MC 1.18.1fabric
February 13, 2022
Initial Relaserelease
MC 1.18.1fabric
February 7, 2022

How to Install SimpleJsonVillagerTrades on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.20-pre1).

3

Install Mod

Open the mod browser in the dashboard and search for "SimpleJsonVillagerTrades". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.20-pre1, 1.19-pre3, 1.19-pre1 (+2 more)

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

SimpleJsonVillagerTrades server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.20-pre1). You can switch loaders with one click in the panel.

Is SimpleJsonVillagerTrades compatible with fabric?

SimpleJsonVillagerTrades officially supports fabric for Minecraft 1.20-pre1, 1.19-pre3, 1.19-pre1. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with SimpleJsonVillagerTrades – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if SimpleJsonVillagerTrades consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install SimpleJsonVillagerTrades with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
Creative Commons Zero v1.0 Universal
Server-side
Required

Supported Versions

1.20-pre11.19-pre31.19-pre11.18.21.18.1