Skip to content

Tweaker Script

Linguardium edited this page Apr 15, 2020 · 12 revisions

Make a LibCD tweaker script location:

  • Mods: resources\data\<yourmodid>\tweakers\
  • Data packs : data\<your modpack namespace>\tweakers\

Understand that LibCD supports more languages than just javascript, but for this demonstration we will use javascript.

At the top of the script, include the TraderTweaker from the mod. You can call the variable whatever you would like, in the examples I use the "TraderTweaker" variable to reference it.

var TraderTweaker = libcd.require("Tradesmen.TraderTweaker");

next, add a trader. see Trader for information on generating a Trader and Trades for creating trades.

TraderTweaker.addTrader( <trader_id> , <trader_object> );
  • trader_id - A unique identifier for the trader. It should be in the format of "namespace:your_trader_id".

    • Example: TraderTweaker.addTrader("yourmodid:players_mom", TraderObject)
  • Trader Object

Clone this wiki locally