VillagerTrades 5.46.0
A small trade table per villager profession and for the wandering trader, picked from Mojang's behaviour pack (trading/economy_trades/*.json: quantities, trader experience and max uses). Only trades with plain items are included: enchanted books and gear, explorer maps, suspicious stew and dyed armour are left out. Each level gets up to two of its trades, chosen at random when the villager reaches the level, like vanilla.
Constants
TIER_EXP_REQUIREMENTS
php
public const TIER_EXP_REQUIREMENTS = [0, 10, 70, 150, 250]Trader experience needed for each level (vanilla).
Methods
createOffers()
php
public static function createOffers(int $profession, int $tier) : arrayCreates up to two random trades of the profession for the level, or none if the profession doesn't trade.
createWanderingTraderOffers()
php
public static function createWanderingTraderOffers() : arrayFive common trades and one rare one, like the vanilla wandering trader.
getTradingProfessions()
php
public static function getTradingProfessions() : arraygetUnknownItemNames()
php
public static function getUnknownItemNames() : arrayReturns the item names of the tables that don't parse (for tests: every trade must be usable).
