Skip to content
EN

Configuration

Configuration · config · Tradery

The settings are three JSON5 files with comments in config/tradery/:

  • server.json5: the currency, balances, /pay, shops, coin ore, villagers, markets, villages, trade crates and map layers.
  • rewards.json5: money for mobs, mined blocks, crafting, fishing and advancements, plus the rules against farms.
  • client.json5: each player's own balance display, hints, village title and notifications.

A value the mod can't read is replaced by its default, with a line in the log. Unknown keys are reported there too. /tradery reload applies server.json5 and rewards.json5 without a restart, with two exceptions: currency.decimals is fixed for a world after its first start, and everything under market needs a server restart.

Currency and accounts

  • currency.name, currency.symbol: "Coins" and "₮". Screens draw a coin icon where the symbol would be.
  • currency.decimals: 2, from 0 to 6.
  • currency.thousandsSeparator: a space. A comma, an apostrophe or nothing also work.
  • economy.startingBalance: 100, given once to every new player.
  • economy.maxBalance: 1000000000. No account can be paid above it; 0 removes the ceiling.
  • pay.enabled, pay.taxPercent, pay.minAmount: true, 0, 1. The tax is destroyed, not paid to anyone.

Shops

  • vending.feePercent: 2. Destroyed from every money sale in a vending block or a market counter.
  • vending.maxPerPlayer: 0, which means no limit. Vending blocks, market counters and trade crates count together.
  • vending.itemBlacklist: ["minecraft:bedrock"]. These items can't be sold or asked as a price.
  • vending.facadeBlacklist: empty. Blocks that can't be used as a facade.
  • vending.defaultAnimation: SPIN_BOB. Also STATIC, SPIN, BOB, NONE.

Coin ore and rewards

  • ore.enabled: true. false stops ore from generating in new chunks.
  • ore.directToBalance: true. false makes mined ore drop coin items.
  • ore.coinValues: 1, 10 and 100 for copper, silver and gold.
  • ore.dailyCap: 0. The most one player can mine per UTC day; 0 is no cap.
  • ore.inflationDamping: off. When on, ore pays less while the money supply is above targetSupply (1000000), down to minFactor (0.25) of its value.

In rewards.json5 only kill is on. mine, craft, fish and advancement are off, and two of them for a reason. A block moved by a piston loses its "placed by a player" mark, so mine can be farmed. With craft, any recipe that can be reversed is free money.

The rules that apply to every reward: rules.dailyCap is 1000 per player per UTC day, and after 20 rewards within 60 seconds each next one pays ×0.5 (rules.diminishing).

Turning the villager part off

Every part has its own switch in server.json5:

  • villagers.enabled: villagers as customers and suppliers
  • villages.suppliers.enabled: suppliers only
  • villagerTrading.enabled: false brings back the vanilla trade window
  • market.enabled: market stalls in new villages
  • villages.caravans.enabled, villages.marketDay.enabled, villages.festival.enabled
  • villages.buildings.enabled: villages saving up and building for themselves
  • tradeCrates.enabled

Villager numbers

  • villagers.visitRadius: 32 blocks, from 4 to 64.
  • villagers.visitChance: 0.25 per check, and a check happens every villagers.checkIntervalTicks (100).
  • villagers.maxPriceRatio: 1.5. Above this multiple of the fair price villagers never buy.
  • villagers.dailyCapPerVillage: 200, times the village level's multiplier.
  • villagerTrading.emeraldValue: 3.
  • villages.levels.thresholds: [0, 300, 1500, 5000]. Every per-level list has four entries, one per level.
  • villages.tradeTaxPercent: 10.
  • villages.council.patronMinContribution, .patronTaxSharePercent, .specializationBonus: 100, 10, 0.15.
  • tradeCrates.maxTradesPerVisit, tradeCrates.hoppers: 16, true.
  • integrations.maps.villages, .shops, .updateSeconds: true, true, 60.

The client file

  • hud.corner: BOTTOM_RIGHT. hud.offsetX and hud.offsetY: 4 GUI pixels. hud.scale: 1.0, from 0.5 to 2.0.
  • hud.format: FULL (1 250.00) or SHORT (1.2K).
  • hud.countUp, hud.popups: the rolling number and the gain and loss lines.
  • notifications.sale, .empty, .noSpace, .offlineSummary: the four kinds of shop messages.
  • vending.animationOverride: SERVER, or your own choice of animation for every block you see.
  • vending.hint: AUTO, ON or OFF. AUTO turns the hints off when Jade or WTHIT is installed. vending.hintY: 8 pixels from the top.
  • villageTitle.enabled, .offsetY, .scale: true, 56, 1.0.

Data packs

What the config doesn't cover lives in data packs under data/<namespace>/tradery/:

  • prices/: the fair price of an item or a tag. Villagers never buy an item that has none.
  • villager_wants/: what each profession buys.
  • villager_supplies/: what each profession produces per day.
  • village_types/: cheap and dear goods of each village type, and caravan trades.
  • village_projects/: cost, level, effects and building of each project.
  • village_buildings/: what villages build for themselves.
  • market/: the offers of market stalls per village type.

Coin ore placement is in data/tradery/worldgen/placed_feature/, and the number of coins per block is in the ore's loot table.

Saving and logs

Balances, villages and wallets are saved with the world. When the game writes a chunk with a vending block that traded, the money and the inventories of the players who traded are written in the same tick, so after a crash the stock, the money and the items still match. I tested this by killing the server process in the middle of a trade.

Every transaction is also written as one JSON line to <world>/tradery/logs/YYYY-MM-DD.log, one file per UTC day, kept for 30 days (log.retentionDays; 0 keeps them forever). The log is written after the fact on its own thread. After a crash it can hold transactions that the world itself rolled back.