public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
Modifier and Type | Class and Description |
---|---|
static class |
EntityRegainHealthEvent.RegainReason
An enum to specify the type of health regaining that is occurring
|
Event.Result
entity
Constructor and Description |
---|
EntityRegainHealthEvent(@NotNull Entity entity,
double amount,
@NotNull EntityRegainHealthEvent.RegainReason regainReason) |
EntityRegainHealthEvent(@NotNull Entity entity,
double amount,
@NotNull EntityRegainHealthEvent.RegainReason regainReason,
boolean isFastRegen) |
Modifier and Type | Method and Description |
---|---|
double |
getAmount()
Gets the amount of regained health
|
static @NotNull HandlerList |
getHandlerList() |
@NotNull HandlerList |
getHandlers() |
@NotNull EntityRegainHealthEvent.RegainReason |
getRegainReason()
Gets the reason for why the entity is regaining health
|
boolean |
isCancelled()
Gets the cancellation state of this event.
|
boolean |
isFastRegen()
Is this event a result of the fast regeneration mechanic
|
void |
setAmount(double amount)
Sets the amount of regained health
|
void |
setCancelled(boolean cancel)
Sets the cancellation state of this event.
|
getEntity, getEntityType
callEvent, getEventName, isAsynchronous
public EntityRegainHealthEvent(@NotNull @NotNull Entity entity, double amount, @NotNull @NotNull EntityRegainHealthEvent.RegainReason regainReason)
public boolean isFastRegen()
public double getAmount()
public void setAmount(double amount)
amount
- the amount of health the entity will regainpublic 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 EntityRegainHealthEvent.RegainReason getRegainReason()
@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2021. All rights reserved.