Skip to content

Adding Data Driven Trade Offers (LibCD Compat Legacy)

Yoghurt4C edited this page Sep 21, 2020 · 2 revisions

Adding Data Driven Trade Offers - LibCD Compat (Legacy)

If you're too lazy to stamp dozens of JSONs, you can use LibCD to add (and remove Trade Offers added via LTR's system) Trade Offers.

  1. Navigate to your data pack (data/modid/), then go to the tweakers/ subfolder.
  2. Create a .js file, name it however you want.
  3. Look at this link. It should be self-explanatory. Acquaint yourself with this wiki page if you're feeling lost in the magic numbers - they may be formatted differently, but both roads lead to the same destination. :)
  4. Removal is done via
var TradeOfferTweaker = libcd.require("mods.ltr.compat.libcd.LilTaterTradeOfferTweaker");
TradeOfferTweaker.removeTradeOffer(id);

, where id is the full Identifier of the Trade Offer you want removed. Currently, there is no way to dump these, so you'll have to do some manual digging through Trade Offers that might've been added by someone else. For example, if you wanted to remove this specific trade, you'd use

TradeOfferTweaker.removeTradeOffer("ltr:potatoes&sugar_for_cocoa_beans");