Cancellable
public class VillagerCareerChangeEvent extends EntityEvent implements Cancellable
Modifier and Type | Class | Description |
---|---|---|
static class |
VillagerCareerChangeEvent.ChangeReason |
Reasons for the villager's profession changing.
|
Event.Result
entity
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.
|
getEntityType
getEventName, isAsynchronous
public VillagerCareerChangeEvent(@NotNull @NotNull Villager what, @NotNull @NotNull Villager.Profession profession, @NotNull @NotNull VillagerCareerChangeEvent.ChangeReason reason)
@NotNull public @NotNull Villager getEntity()
EntityEvent
getEntity
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()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(@NotNull @org.jetbrains.annotations.NotNull boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- 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.