All Mods Resource Packs Data Packs Shaders Modpacks Plugins
SimpleJsonVillagerTrades

SimpleJsonVillagerTrades

by aws404 • Downloads: 0 • Followers: 0
Description
Gallery
Changelog
Versions

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'

How to Install SimpleJsonVillagerTrades (Mod)

SimpleJsonVillagerTrades by aws404 is verified for Fabric across Minecraft versions 1.18.1, 1.18.2, 1.19-pre1, 1.19-pre3, 1.20-pre1 (latest release: 1.3.0-pre1+1.20-pre1, file size: 60 KB). Follow the steps below to install it safely from ModCraft.tv:

  1. Click the Download button above and select your Minecraft version (1.18.1, 1.18.2, 1.19-pre1, 1.19-pre3, 1.20-pre1) and platform (Fabric).
  2. Make sure you have the compatible loader or environment installed for Fabric.
  3. Move the downloaded SimpleJsonVillagerTrades file into your Minecraft .minecraft/mods folder and launch the game.

All Versions

+ Add Version
Name Game version Platforms Published Downloads Actions
1.20-pre1
Fabric
last yr. 1
1.19-pre3
Fabric
last yr. 1
1.19-pre3
Fabric
last yr. 1
1.19-pre1
Fabric
last yr. 1
1.19-pre1
Fabric
last yr. 1
1.19-pre1
Fabric
last yr. 1
1.18.2
Fabric
last yr. 1
1.18.1
Fabric
last yr. 1
1.18.1
Fabric
last yr. 1
Update to 1.20-pre1
[1.2.0+pre6] 1.2.0+pre6 by aws404 on May 28, 2022
Download
Fixed an issue requiring ARRP to be present.
[1.2.0+pre5] 1.2.0+pre5 by aws404 on May 27, 2022
Download
  • Update to 1.19+pre3
  • Improved codec handling
  • Add sjvt:type_aware factory type
[1.2.0+pre1] 1.2.0+pre1 by aws404 on May 22, 2022
Download
Update to 1.19
[1.1.0] Release 1.1.0 by aws404 on May 04, 2022
Download


[1.0.1] Bug Fix 1.0.1 by aws404 on Feb 13, 2022
Download
  • Fix swapped argument names (price and count) in the minecraft:sell_item factory.
SimpleJsonVillagerTrades Icon
Download SimpleJsonVillagerTrades
Select game version
Select platform