Class PlayerTradeVillagerGUIEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.event.player.PlayerTradeVillagerGUIEvent
All Implemented Interfaces:
Cancellable

public class PlayerTradeVillagerGUIEvent extends PlayerEvent implements Cancellable
This event is getting called when the player wants to do a transaction within a VillagerGUI
  • Constructor Details

  • Method Details

    • getGUI

      public VillagerGUI getGUI()
      Returns the GUI that was opened and in which the player performs his transaction.
      Returns:
      The GUI
    • getInventory

      public Inventory getInventory()
      Returns Bukkit's inventory on which has been clicked.
      Returns:
      The inventory
    • getOffer

      public VillagerOffer getOffer()
      Returns the offer involved in this transaction
      Returns:
      The offer
    • getGivenResult

      public ItemStack getGivenResult()
      Returns the items that will be given if this even passes.
      Returns:
      The items that will be given to the player
    • getFirstGivenPrice

      public ItemStack getFirstGivenPrice()
      Returns the first price that was offered by the player.
      Returns:
      The item that the player inserted as the first price
    • getSecondGivenPrice

      @Nullable public @Nullable ItemStack getSecondGivenPrice()
      Returns the second price that was offered by the player. Might be null if the offer doesn't require it
      Returns:
      The item that the player inserted as the second price
    • isShiftClick

      public boolean isShiftClick()
      Gets whether the ClickType for this event indicates that the key was pressed down when the click was made.
      Returns:
      true if he pressed shift while clicking on it
    • isLeftClick

      public boolean isLeftClick()
      Gets whether or not the ClickType for this event represents a left click.
      Returns:
      true if he clicked the left mouse button
    • isRightClick

      public boolean isRightClick()
      Gets whether or not the ClickType for this event represents a right click.
      Returns:
      true if he clicked the right mouse button
    • getHandlers

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()