Interface TradeOfferHelper.WanderingTraderOffersBuilder

Enclosing class:
TradeOfferHelper

@NonExtendable public static interface TradeOfferHelper.WanderingTraderOffersBuilder
A builder for wandering trader offers.
See Also:
  • Field Details

    • BUY_ITEMS_POOL

      static final net.minecraft.resources.Identifier BUY_ITEMS_POOL
      The pool ID for the "buy items" pool. Two trade offers are picked from this pool.

      In vanilla, this pool contains offers to buy water buckets, baked potatoes, etc. for emeralds.

    • SELL_SPECIAL_ITEMS_POOL

      static final net.minecraft.resources.Identifier SELL_SPECIAL_ITEMS_POOL
      The pool ID for the "sell special items" pool. Two trade offers are picked from this pool.

      In vanilla, this pool contains offers to sell logs, enchanted iron pickaxes, etc.

    • SELL_COMMON_ITEMS_POOL

      static final net.minecraft.resources.Identifier SELL_COMMON_ITEMS_POOL
      The pool ID for the "sell common items" pool. Five trade offers are picked from this pool.

      In vanilla, this pool contains offers to sell flowers, saplings, etc.

  • Method Details

    • pool

      TradeOfferHelper.WanderingTraderOffersBuilder pool(net.minecraft.resources.Identifier id, int count, net.minecraft.world.entity.npc.villager.VillagerTrades.ItemListing... factories)
      Adds a new pool to the offer list. Exactly count offers are picked from factories and offered to customers.
      Parameters:
      id - the ID to be assigned to this pool, to allow further modification
      count - the number of offers to be picked from factories
      factories - the trade offer factories
      Returns:
      this builder, for chaining
      Throws:
      IllegalArgumentException - if count is not positive or if factories is empty
    • pool

      default TradeOfferHelper.WanderingTraderOffersBuilder pool(net.minecraft.resources.Identifier id, int count, Collection<? extends net.minecraft.world.entity.npc.villager.VillagerTrades.ItemListing> factories)
      Adds a new pool to the offer list. Exactly count offers are picked from factories and offered to customers.
      Parameters:
      id - the ID to be assigned to this pool, to allow further modification
      count - the number of offers to be picked from factories
      factories - the trade offer factories
      Returns:
      this builder, for chaining
      Throws:
      IllegalArgumentException - if count is not positive or if factories is empty
    • addAll

      default TradeOfferHelper.WanderingTraderOffersBuilder addAll(net.minecraft.resources.Identifier id, Collection<? extends net.minecraft.world.entity.npc.villager.VillagerTrades.ItemListing> factories)
      Adds trade offers to the offer list. All offers from factories are offered to each customer.
      Parameters:
      id - the ID to be assigned to this pool, to allow further modification
      factories - the trade offer factories
      Returns:
      this builder, for chaining
      Throws:
      IllegalArgumentException - if factories is empty
    • addAll

      default TradeOfferHelper.WanderingTraderOffersBuilder addAll(net.minecraft.resources.Identifier id, net.minecraft.world.entity.npc.villager.VillagerTrades.ItemListing... factories)
      Adds trade offers to the offer list. All offers from factories are offered to each customer.
      Parameters:
      id - the ID to be assigned to this pool, to allow further modification
      factories - the trade offer factories
      Returns:
      this builder, for chaining
      Throws:
      IllegalArgumentException - if factories is empty
    • addOffersToPool

      TradeOfferHelper.WanderingTraderOffersBuilder addOffersToPool(net.minecraft.resources.Identifier pool, net.minecraft.world.entity.npc.villager.VillagerTrades.ItemListing... factories)
      Adds trade offers to an existing pool identified by an ID.

      See the constants for vanilla trade offer pool IDs that are always available.

      Parameters:
      pool - the pool ID
      factories - the trade offer factories
      Returns:
      this builder, for chaining
      Throws:
      IndexOutOfBoundsException - if pool is out of bounds
    • addOffersToPool

      default TradeOfferHelper.WanderingTraderOffersBuilder addOffersToPool(net.minecraft.resources.Identifier pool, Collection<net.minecraft.world.entity.npc.villager.VillagerTrades.ItemListing> factories)
      Adds trade offers to an existing pool identified by an ID.

      See the constants for vanilla trade offer pool IDs that are always available.

      Parameters:
      pool - the pool ID
      factories - the trade offer factories
      Returns:
      this builder, for chaining
      Throws:
      IndexOutOfBoundsException - if pool is out of bounds