Cancellablepublic class PlayerTradeEvent extends PlayerEvent implements Cancellable
Event.Resultplayer| Constructor | Description |
|---|---|
PlayerTradeEvent(Player player,
AbstractVillager villager,
MerchantRecipe trade,
boolean rewardExp,
boolean increaseTradeUses) |
| Modifier and Type | Method | Description |
|---|---|---|
static HandlerList |
getHandlerList() |
|
HandlerList |
getHandlers() |
|
MerchantRecipe |
getTrade() |
Gets the associated trade with this event
|
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(MerchantRecipe trade) |
Sets the trade.
|
boolean |
willIncreaseTradeUses() |
callEvent, getEventName, isAsynchronousclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetPlayerpublic PlayerTradeEvent(@NotNull Player player, @NotNull AbstractVillager villager, @NotNull MerchantRecipe trade, boolean rewardExp, boolean increaseTradeUses)
@NotNull public AbstractVillager getVillager()
@NotNull public MerchantRecipe getTrade()
public void setTrade(@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 HandlerList getHandlers()
getHandlers in class Event@NotNull public static HandlerList getHandlerList()
Copyright © 2021. All rights reserved.