Class 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.

  • Constructor Details

    • TradeSelectEvent

      public TradeSelectEvent(@NotNull MerchantView 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 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 Merchant getMerchant()
      Get the Merchant involved.
      Returns:
      the Merchant
    • getView

      @NotNull public MerchantView getView()
      Description copied from class: InventoryEvent
      Gets the view object itself
      Overrides:
      getView in class InventoryEvent
      Returns:
      InventoryView
    • getHandlers

      @NotNull public HandlerList getHandlers()
      Overrides:
      getHandlers in class InventoryEvent
    • getHandlerList

      @NotNull public static HandlerList getHandlerList()