public class PlayerTradeEvent extends PlayerEvent implements Cancellable
Event.Resultplayer| Constructor and Description |
|---|
PlayerTradeEvent(@NotNull Player player,
@NotNull AbstractVillager villager,
@NotNull MerchantRecipe trade,
boolean rewardExp,
boolean increaseTradeUses) |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@NotNull MerchantRecipe |
getTrade()
Gets the associated trade with this event
|
@NotNull AbstractVillager |
getVillager()
Gets the Villager or Wandering trader associated with this event
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
boolean |
isRewardingExp() |
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setIncreaseTradeUses(boolean increaseTradeUses)
Sets whether or not the trade will count as a use
|
void |
setRewardExp(boolean rewardExp)
Sets whether the trade will try to reward exp
|
void |
setTrade(@Nullable MerchantRecipe trade)
Sets the trade.
|
boolean |
willIncreaseTradeUses() |
getPlayercallEvent, getEventName, isAsynchronouspublic PlayerTradeEvent(@NotNull @NotNull Player player, @NotNull @NotNull AbstractVillager villager, @NotNull @NotNull MerchantRecipe trade, boolean rewardExp, boolean increaseTradeUses)
@NotNull public @NotNull AbstractVillager getVillager()
@NotNull public @NotNull MerchantRecipe getTrade()
public void setTrade(@Nullable @Nullable MerchantRecipe trade)
trade - the trade to usepublic boolean isRewardingExp()
public void setRewardExp(boolean rewardExp)
rewardExp - try to reward exppublic boolean willIncreaseTradeUses()
public void setIncreaseTradeUses(boolean increaseTradeUses)
increaseTradeUses - true to count/false to not countpublic boolean isCancelled()
isCancelled in interface Cancellablepublic void setCancelled(boolean cancel)
setCancelled in interface Cancellablecancel - true if you wish to cancel this event@NotNull public @NotNull HandlerList getHandlers()
getHandlers in class Event@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.