Package org.bukkit.event.inventory

# Class TradeSelectEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.inventory.InventoryEvent
org.bukkit.event.inventory.InventoryInteractEvent
org.bukkit.event.inventory.TradeSelectEvent

All Implemented Interfaces:
  `Cancellable`

public class TradeSelectEvent extends InventoryInteractEvent
This event is called whenever a player clicks a new trade on the trades sidebar.

This event allows the user to get the index of the trade, letting them get the MerchantRecipe via the Merchant.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Field Summary

### Fields inherited from class org.bukkit.event.inventory.InventoryEvent

`transaction`

## Constructor Summary

Constructors
Constructor
Description
`TradeSelectEvent(@NotNull InventoryView transaction, int newIndex)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`int`
`getIndex()`
Used to get the index of the trade the player clicked on.
`@NotNull MerchantInventory`
`getInventory()`
Gets the primary Inventory involved in this transaction
`@NotNull Merchant`
`getMerchant()`
Get the Merchant involved.

### Methods inherited from class org.bukkit.event.inventory.InventoryInteractEvent

`getResult, getWhoClicked, isCancelled, setCancelled, setResult`

### Methods inherited from class org.bukkit.event.inventory.InventoryEvent

`getView, getViewers`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### TradeSelectEvent

public TradeSelectEvent(@NotNull @NotNull InventoryView transaction, int newIndex)

## Method Details

### getIndex

public int getIndex()
Used to get the index of the trade the player clicked on.

Returns:
  The index of the trade clicked by the player

### getInventory

@NotNull public @NotNull MerchantInventory getInventory()
Description copied from class: `InventoryEvent`
Gets the primary Inventory involved in this transaction

Overrides:
  `getInventory` in class `InventoryEvent`
Returns:
  The upper inventory.

### getMerchant

@NotNull public @NotNull Merchant getMerchant()
Get the Merchant involved.

Returns:
  the Merchant

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Overrides:
  `getHandlers` in class `InventoryEvent`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()