Class TradeRegistry

java.lang.Object
dev.architectury.registry.level.entity.trade.TradeRegistry

public class TradeRegistry extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    registerTradeForWanderingTrader(boolean rare, net.minecraft.world.entity.npc.VillagerTrades.ItemListing... trades)
    Register a trade (VillagerTrades.ItemListing) to a wandering trader by its rarity.
    static void
    registerVillagerTrade(net.minecraft.world.entity.npc.VillagerProfession profession, int level, net.minecraft.world.entity.npc.VillagerTrades.ItemListing... trades)
    Register a trade (VillagerTrades.ItemListing) for a villager by its profession and level.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • registerVillagerTrade

      public static void registerVillagerTrade(net.minecraft.world.entity.npc.VillagerProfession profession, int level, net.minecraft.world.entity.npc.VillagerTrades.ItemListing... trades)
      Register a trade (VillagerTrades.ItemListing) for a villager by its profession and level. When the mod loader is Forge, the VillagerTradesEvent event is used.
      Parameters:
      profession - The Profession the villager needs to have this trade.
      level - The level the villager needs. Vanilla range is 1 to 5, however mods may extend that upper limit further.
      trades - The trades to add to this profession at the specified level.
    • registerTradeForWanderingTrader

      public static void registerTradeForWanderingTrader(boolean rare, net.minecraft.world.entity.npc.VillagerTrades.ItemListing... trades)
      Register a trade (VillagerTrades.ItemListing) to a wandering trader by its rarity. When the mod loader is Forge, the WandererTradesEvent event is used.
      Parameters:
      rare - Whether this trade is "rare". Rare trades have a five times lower chance of being used.
      trades - The trades to add to the wandering trader.