How Traders was built

Raw game files read

Processing

Each config/tradelists/trader-<specialization>.json (and villager-<name>.json) file is a flat {money, selling, buying} object; entries repeating the same item under different cosmetic attributes (e.g. a tapestry listed many times under different "type" values) are collapsed to one listing, since those variations are randomized/cosmetic rather than distinct tradeable things.

There's no explicit field anywhere linking a specialization to the trader entity that actually uses it -- entities/humanoid/trader-{male,female}.json's own variantgroups declares a type dimension whose states are the specialization codes, and the entity's attributes.tradePropsFile substitutes that same value into the tradelist filename. Every concrete entity variant whose type matches a loaded specialization's code is linked back to it; the 8 villager-* tradelists intentionally resolve to no entity, since named villagers aren't assigned a specialization through this mechanism at all.

Pipeline code