Package org.bukkit.inventory
Interface Merchant
- All Known Subinterfaces:
- AbstractVillager,- Villager,- WanderingTrader
public interface Merchant
Represents a merchant. A merchant is a special type of inventory which can
 facilitate custom trades between items.
- 
Method SummaryModifier and TypeMethodDescriptiongetRecipe(int i) Get the recipe at a certain index of this merchant's trade list.intGet the number of trades this merchant currently has available.Get a list of trades currently available from this merchant.Gets the player this merchant is trading with, or null if it is not currently trading.booleanGets whether this merchant is currently trading.voidsetRecipe(int i, @NotNull MerchantRecipe recipe) Set the recipe at a certain index of this merchant's trade list.voidsetRecipes(@NotNull List<MerchantRecipe> recipes) Set the list of trades currently available from this merchant.
- 
Method Details- 
getRecipesGet a list of trades currently available from this merchant.- Returns:
- an immutable list of trades
 
- 
setRecipesSet the list of trades currently available from this merchant.
 This will not change the selected trades of players currently trading with this merchant.- Parameters:
- recipes- a list of recipes
 
- 
getRecipeGet the recipe at a certain index of this merchant's trade list.- Parameters:
- i- the index
- Returns:
- the recipe
- Throws:
- IndexOutOfBoundsException- if recipe index out of bounds
 
- 
setRecipeSet the recipe at a certain index of this merchant's trade list.- Parameters:
- i- the index
- recipe- the recipe
- Throws:
- IndexOutOfBoundsException- if recipe index out of bounds
 
- 
getRecipeCountint getRecipeCount()Get the number of trades this merchant currently has available.- Returns:
- the recipe count
 
- 
isTradingboolean isTrading()Gets whether this merchant is currently trading.- Returns:
- whether the merchant is trading
 
- 
getTraderGets the player this merchant is trading with, or null if it is not currently trading.- Returns:
- the trader, or null
 
 
-