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
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 Event
Event.Result -
Field Summary
Fields inherited from class InventoryEvent
transaction -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListintgetIndex()Used to get the index of the trade the player clicked on.Gets the primary Inventory involved in this transactionGet the Merchant involved.getView()Gets the view object itselfMethods inherited from class InventoryInteractEvent
getResult, getWhoClicked, isCancelled, setCancelled, setResultMethods inherited from class InventoryEvent
getViewersMethods inherited from class Event
getEventName, isAsynchronous
-
Constructor Details
-
TradeSelectEvent
-
-
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
Description copied from class:InventoryEventGets the primary Inventory involved in this transaction- Overrides:
getInventoryin classInventoryEvent- Returns:
- The upper inventory.
-
getMerchant
-
getView
Description copied from class:InventoryEventGets the view object itself- Overrides:
getViewin classInventoryEvent- Returns:
- InventoryView
-
getHandlers
- Overrides:
getHandlersin classInventoryEvent
-
getHandlerList
-