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
This event is getting called when the player wants to do a transaction within a
VillagerGUI-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerTradeVillagerGUIEvent(Player who, VillagerGUI gui, Inventory inv, VillagerOffer offer, ItemStack givenResult, ItemStack givenPrice1, @Nullable ItemStack givenPrice2, boolean isShiftClick, boolean isLeftClick) -
Method Summary
Modifier and TypeMethodDescriptionReturns the first price that was offered by the player.Returns the items that will be given if this even passes.getGUI()Returns the GUI that was opened and in which the player performs his transaction.static HandlerListReturns Bukkit's inventory on which has been clicked.getOffer()Returns the offer involved in this transaction@Nullable ItemStackReturns the second price that was offered by the player.booleanGets whether or not the ClickType for this event represents a left click.booleanGets whether or not the ClickType for this event represents a right click.booleanGets whether the ClickType for this event indicates that the key was pressed down when the click was made.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronousMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.bukkit.event.Cancellable
isCancelled, setCancelled
-
Constructor Details
-
PlayerTradeVillagerGUIEvent
public PlayerTradeVillagerGUIEvent(Player who, VillagerGUI gui, Inventory inv, VillagerOffer offer, ItemStack givenResult, ItemStack givenPrice1, @Nullable @Nullable ItemStack givenPrice2, boolean isShiftClick, boolean isLeftClick)
-
-
Method Details
-
getGUI
Returns the GUI that was opened and in which the player performs his transaction.- Returns:
- The GUI
-
getInventory
Returns Bukkit's inventory on which has been clicked.- Returns:
- The inventory
-
getOffer
Returns the offer involved in this transaction- Returns:
- The offer
-
getGivenResult
Returns the items that will be given if this even passes.- Returns:
- The items that will be given to the player
-
getFirstGivenPrice
Returns the first price that was offered by the player.- Returns:
- The item that the player inserted as the first price
-
getSecondGivenPrice
Returns the second price that was offered by the player. Might benullif 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:
trueif 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:
trueif he clicked the left mouse button
-
isRightClick
public boolean isRightClick()Gets whether or not the ClickType for this event represents a right click.- Returns:
trueif he clicked the right mouse button
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-