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 Event
Event.Result -
Field Summary
Fields inherited from class PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerTradeEvent(Player player, AbstractVillager villager, MerchantRecipe trade, boolean rewardExp, boolean increaseTradeUses) -
Method Summary
Modifier and TypeMethodDescriptionGets the merchant that the player is trading withGets the Villager or Wandering trader associated with this eventMethods inherited from class PlayerPurchaseEvent
getHandlerList, getHandlers, getTrade, isCancelled, isRewardingExp, setCancelled, setIncreaseTradeUses, setRewardExp, setTrade, willIncreaseTradeUsesMethods inherited from class PlayerEvent
getPlayerMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerTradeEvent
@Internal public PlayerTradeEvent(Player player, AbstractVillager villager, MerchantRecipe trade, boolean rewardExp, boolean increaseTradeUses)
-
-
Method Details
-
getMerchant
Description copied from class:PlayerPurchaseEventGets the merchant that the player is trading with- Overrides:
getMerchantin classPlayerPurchaseEvent- Returns:
- the merchant
-
getVillager
Gets the Villager or Wandering trader associated with this event- Returns:
- the villager or wandering trader
- See Also:
-