Package io.papermc.paper.event.player
Class PlayerPurchaseEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerPurchaseEvent
- All Implemented Interfaces:
- Cancellable
- Direct Known Subclasses:
- PlayerTradeEvent
Called when a player trades with a standalone merchant GUI.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructorsConstructorDescriptionPlayerPurchaseEvent(@NotNull Player player, @NotNull MerchantRecipe trade, boolean rewardExp, boolean increaseTradeUses) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic @NotNull HandlerListgetTrade()Gets the associated trade with this eventbooleanGets the cancellation state of this event.booleanvoidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetIncreaseTradeUses(boolean increaseTradeUses) Sets whether or not the trade will count as a usevoidsetRewardExp(boolean rewardExp) Sets whether the trade will try to reward expvoidsetTrade(@NotNull MerchantRecipe trade) Sets the trade.booleanMethods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
PlayerPurchaseEvent
 
- 
- 
Method Details- 
getTradeGets the associated trade with this event- Returns:
- the trade
 
- 
setTradeSets the trade. This is then used to determine the next prices- Parameters:
- trade- the trade to use
 
- 
isRewardingExppublic boolean isRewardingExp()- Returns:
- will trade try to reward exp
 
- 
setRewardExppublic void setRewardExp(boolean rewardExp) Sets whether the trade will try to reward exp- Parameters:
- rewardExp- try to reward exp
 
- 
willIncreaseTradeUsespublic boolean willIncreaseTradeUses()- Returns:
- whether or not the trade will count as a use of the trade
 
- 
setIncreaseTradeUsespublic void setIncreaseTradeUses(boolean increaseTradeUses) Sets whether or not the trade will count as a use- Parameters:
- increaseTradeUses- true to count/false to not count
 
- 
isCancelledpublic boolean isCancelled()Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
- isCancelledin interface- Cancellable
- Returns:
- true if this event is cancelled
 
- 
setCancelledpublic void setCancelled(boolean cancel) Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
- setCancelledin interface- Cancellable
- Parameters:
- cancel- true if you wish to cancel this event
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-