Cancellablepublic class VillagerCareerChangeEvent extends EntityEvent implements Cancellable
| Modifier and Type | Class | Description |
|---|---|---|
static class |
VillagerCareerChangeEvent.ChangeReason |
Reasons for the villager's profession changing.
|
Event.Resultentity| Constructor | Description |
|---|---|
VillagerCareerChangeEvent(@NotNull Villager what,
@NotNull Villager.Profession profession,
@NotNull VillagerCareerChangeEvent.ChangeReason reason) |
| Modifier and Type | Method | Description |
|---|---|---|
@NotNull Villager |
getEntity() |
Returns the Entity involved in this event
|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
@NotNull Villager.Profession |
getProfession() |
Gets the future profession of the villager.
|
@NotNull 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(@org.jetbrains.annotations.NotNull boolean cancel) |
Sets the cancellation state of this event.
|
void |
setProfession(@NotNull Villager.Profession profession) |
Sets the profession the villager will become from this event.
|
getEntityTypegetEventName, isAsynchronouspublic VillagerCareerChangeEvent(@NotNull
@NotNull Villager what,
@NotNull
@NotNull Villager.Profession profession,
@NotNull
@NotNull VillagerCareerChangeEvent.ChangeReason reason)
@NotNull public @NotNull Villager getEntity()
EntityEventgetEntity in class EntityEvent@NotNull public @NotNull Villager.Profession getProfession()
public void setProfession(@NotNull
@NotNull Villager.Profession profession)
profession - new profession@NotNull public @NotNull VillagerCareerChangeEvent.ChangeReason getReason()
public boolean isCancelled()
CancellableisCancelled in interface Cancellablepublic void setCancelled(@NotNull
@org.jetbrains.annotations.NotNull boolean cancel)
CancellablesetCancelled 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 © 2020. All rights reserved.