public class EntityExhaustionEvent extends EntityEvent implements Cancellable
Modifier and Type | Class and Description |
---|---|
static class |
EntityExhaustionEvent.ExhaustionReason
The reason for why a PlayerExhaustionEvent takes place
|
Event.Result
entity
Constructor and Description |
---|
EntityExhaustionEvent(@NotNull HumanEntity who,
@NotNull EntityExhaustionEvent.ExhaustionReason exhaustionReason,
float exhaustion) |
Modifier and Type | Method and Description |
---|---|
@NotNull HumanEntity |
getEntity()
Returns the Entity involved in this event
|
float |
getExhaustion()
Get the amount of exhaustion to add to the player's current exhaustion.
|
@NotNull EntityExhaustionEvent.ExhaustionReason |
getExhaustionReason()
Gets the
EntityExhaustionEvent.ExhaustionReason for this event |
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
boolean |
isCancelled()
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
void |
setExhaustion(float exhaustion)
Set the exhaustion to apply to the player.
|
getEntityType
callEvent, getEventName, isAsynchronous
public EntityExhaustionEvent(@NotNull @NotNull HumanEntity who, @NotNull @NotNull EntityExhaustionEvent.ExhaustionReason exhaustionReason, float exhaustion)
@NotNull public @NotNull EntityExhaustionEvent.ExhaustionReason getExhaustionReason()
EntityExhaustionEvent.ExhaustionReason
for this eventpublic float getExhaustion()
public void setExhaustion(float exhaustion)
exhaustion
- new exhaustion to add@NotNull public @NotNull HumanEntity getEntity()
EntityEvent
getEntity
in class EntityEvent
public 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 @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.