Package org.bukkit.inventory

# Interface MerchantInventory

All Superinterfaces:
  `Inventory`, `Iterable<ItemStack>`

public interface MerchantInventory extends Inventory
Represents a trading inventory between a player and a merchant.
The holder of this Inventory is the owning Villager, or null if the player is trading with a merchant created by a plugin.

## Method Summary

Modifier and Type
Method
Description
`@NotNull Merchant`
`getMerchant()`
Gets the Merchant associated with this inventory.
`@Nullable MerchantRecipe`
`getSelectedRecipe()`
Get the currently active recipe.
`int`
`getSelectedRecipeIndex()`
Get the index of the currently selected recipe.

### Methods inherited from interface org.bukkit.inventory.Inventory

`addItem, all, all, clear, clear, close, contains, contains, contains, contains, containsAtLeast, first, first, firstEmpty, getContents, getHolder, getHolder, getItem, getLocation, getMaxStackSize, getSize, getStorageContents, getType, getViewers, isEmpty, iterator, iterator, remove, remove, removeItem, removeItemAnySlot, setContents, setItem, setMaxStackSize, setStorageContents`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Method Details

### getSelectedRecipeIndex

int getSelectedRecipeIndex()
Get the index of the currently selected recipe.

Returns:
  the index of the currently selected recipe

### getSelectedRecipe

@Nullable @Nullable MerchantRecipe getSelectedRecipe()
Get the currently active recipe.

This will be `null` if the items provided by the player do not match the ingredients of the selected recipe. This does not necessarily match the recipe selected by the player: If the player has selected the first recipe, the merchant will search all of its offers for a matching recipe to activate.

Returns:
  the currently active recipe

### getMerchant

@NotNull @NotNull Merchant getMerchant()
Gets the Merchant associated with this inventory.

Returns:
  merchant