public class VillagerReplenishTradeEvent extends EntityEvent implements Cancellable
Villager
is about to restock one of its trades.
If this event passes, the villager will reset the
uses
of the affected MerchantRecipe
to 0
.
Event.Result
entity
Constructor and Description |
---|
VillagerReplenishTradeEvent(AbstractVillager what,
MerchantRecipe recipe) |
Modifier and Type | Method and Description |
---|---|
int |
getBonus()
Deprecated.
MC 1.14 has changed how villagers restock their trades. Use
MerchantRecipe.getUses() . |
AbstractVillager |
getEntity()
Returns the Entity involved in this event
|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
MerchantRecipe |
getRecipe()
Get the recipe to replenish.
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setBonus(int bonus)
Deprecated.
MC 1.14 has changed how villagers restock their trades. This
has no effect anymore.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setRecipe(MerchantRecipe recipe)
Set the recipe to replenish.
|
getEntityType
getEventName, isAsynchronous
public VillagerReplenishTradeEvent(@NotNull AbstractVillager what, @NotNull MerchantRecipe recipe)
@NotNull public MerchantRecipe getRecipe()
public void setRecipe(@NotNull MerchantRecipe recipe)
recipe
- the replenished recipe@Deprecated public int getBonus()
MerchantRecipe.getUses()
.@Deprecated public void setBonus(int bonus)
bonus
- the extra uses addedpublic boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event@NotNull public AbstractVillager getEntity()
EntityEvent
getEntity
in class EntityEvent
@NotNull public HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static HandlerList getHandlerList()
Copyright © 2022. All rights reserved.