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
ConstructorDescriptionPlayerTradeVillagerGUIEvent
(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 HandlerList
Returns Bukkit's inventory on which has been clicked.getOffer()
Returns the offer involved in this transaction@Nullable ItemStack
Returns the second price that was offered by the player.boolean
Gets whether or not the ClickType for this event represents a left click.boolean
Gets whether or not the ClickType for this event represents a right click.boolean
Gets 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
getPlayer
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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 benull
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
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-