Package io.papermc.paper.event.player
Class PlayerTradeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
io.papermc.paper.event.player.PlayerPurchaseEvent
io.papermc.paper.event.player.PlayerTradeEvent
- All Implemented Interfaces:
Cancellable
Called when a player trades with a villager or wandering trader
-
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
ConstructorDescriptionPlayerTradeEvent
(@NotNull Player player, @NotNull AbstractVillager villager, @NotNull MerchantRecipe trade, boolean rewardExp, boolean increaseTradeUses) -
Method Summary
Modifier and TypeMethodDescriptionGets the Villager or Wandering trader associated with this eventMethods inherited from class io.papermc.paper.event.player.PlayerPurchaseEvent
getHandlerList, getHandlers, getTrade, isCancelled, isRewardingExp, setCancelled, setIncreaseTradeUses, setRewardExp, setTrade, willIncreaseTradeUses
Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerTradeEvent
@Internal public PlayerTradeEvent(@NotNull @NotNull Player player, @NotNull @NotNull AbstractVillager villager, @NotNull @NotNull MerchantRecipe trade, boolean rewardExp, boolean increaseTradeUses)
-
-
Method Details
-
getVillager
Gets the Villager or Wandering trader associated with this event- Returns:
- the villager or wandering trader
-