public class VillagerCareerChangeEvent extends EntityEvent implements Cancellable
Modifier and Type | Class and Description |
---|---|
static class |
VillagerCareerChangeEvent.ChangeReason
Reasons for the villager's profession changing.
|
Event.Result
entity
Constructor and Description |
---|
VillagerCareerChangeEvent(Villager what,
Villager.Profession profession,
VillagerCareerChangeEvent.ChangeReason reason) |
Modifier and Type | Method and Description |
---|---|
Villager |
getEntity()
Returns the Entity involved in this event
|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
Villager.Profession |
getProfession()
Gets the future profession of the villager.
|
VillagerCareerChangeEvent.ChangeReason |
getReason()
Gets the reason for why the villager's career is changing.
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setProfession(Villager.Profession profession)
Sets the profession the villager will become from this event.
|
getEntityType
callEvent, getEventName, isAsynchronous
public VillagerCareerChangeEvent(@NotNull Villager what, @NotNull Villager.Profession profession, @NotNull VillagerCareerChangeEvent.ChangeReason reason)
@NotNull public Villager getEntity()
EntityEvent
getEntity
in class EntityEvent
@NotNull public Villager.Profession getProfession()
public void setProfession(@NotNull Villager.Profession profession)
profession
- new profession@NotNull public VillagerCareerChangeEvent.ChangeReason getReason()
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(@NotNull boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event@NotNull public HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static HandlerList getHandlerList()
Copyright © 2022. All rights reserved.