Class WandererTradesEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.village.WandererTradesEvent

public class WandererTradesEvent extends net.neoforged.bus.api.Event
WandererTradesEvent is fired during reload by TagsUpdatedEvent. It is used to gather the trade lists for the wandering merchant. It is fired on the NeoForge.EVENT_BUS. For each set of trades the wandering merchant picks the specified amount of trades from the corresponding list. To add trades to the merchant, simply add new trades to the list. BasicItemListing provides a default implementation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected List<org.apache.commons.lang3.tuple.Pair<List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>,Integer>>
     
    protected List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>
     
    protected int
     
    protected List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>
     
    protected int
     
    protected List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>
     
    protected int
     
    private final net.minecraft.core.HolderLookup.Provider
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    WandererTradesEvent(List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> buying, int buyingAmount, List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> rare, int rareAmount, List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> generic, int genericAmount, List<org.apache.commons.lang3.tuple.Pair<List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>,Integer>> additionalTrades, net.minecraft.core.HolderLookup.Provider registries)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addTrades(List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> trades, int amount)
     
    int
     
    List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>
     
    int
     
    List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>
     
    int
     
    List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>
     
    net.minecraft.core.HolderLookup.Provider
     
    void
    setBuyingAmount(int amount)
     
    void
    setGenericAmount(int amount)
     
    void
    setRareAmount(int amount)
     

    Methods inherited from class java.lang.Object

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

    • buying

      protected List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> buying
    • buyingAmount

      protected int buyingAmount
    • rare

      protected List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> rare
    • rareAmount

      protected int rareAmount
    • generic

      protected List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> generic
    • genericAmount

      protected int genericAmount
    • additionalTrades

      protected List<org.apache.commons.lang3.tuple.Pair<List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>,Integer>> additionalTrades
    • registries

      private final net.minecraft.core.HolderLookup.Provider registries
  • Constructor Details

    • WandererTradesEvent

      @Internal public WandererTradesEvent(List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> buying, int buyingAmount, List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> rare, int rareAmount, List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> generic, int genericAmount, List<org.apache.commons.lang3.tuple.Pair<List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing>,Integer>> additionalTrades, net.minecraft.core.HolderLookup.Provider registries)
  • Method Details

    • getBuyingTrades

      public List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> getBuyingTrades()
    • getBuyingAmount

      public int getBuyingAmount()
    • setBuyingAmount

      public void setBuyingAmount(int amount)
    • getRareTrades

      public List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> getRareTrades()
    • getRareAmount

      public int getRareAmount()
    • setRareAmount

      public void setRareAmount(int amount)
    • getGenericTrades

      public List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> getGenericTrades()
    • getGenericAmount

      public int getGenericAmount()
    • setGenericAmount

      public void setGenericAmount(int amount)
    • addTrades

      public void addTrades(List<net.minecraft.world.entity.npc.VillagerTrades.ItemListing> trades, int amount)
    • getRegistries

      public net.minecraft.core.HolderLookup.Provider getRegistries()