cn.nukkit.event.entity.EntityRegainHealthEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of powernukkit Show documentation
Show all versions of powernukkit Show documentation
A Minecraft Bedrock Edition server software implementation made in Java from scratch which supports all new features.
package cn.nukkit.event.entity;
import cn.nukkit.entity.Entity;
import cn.nukkit.event.Cancellable;
import cn.nukkit.event.HandlerList;
/**
* @author MagicDroidX (Nukkit Project)
*/
public class EntityRegainHealthEvent extends EntityEvent implements Cancellable {
private static final HandlerList handlers = new HandlerList();
public static HandlerList getHandlers() {
return handlers;
}
public static final int CAUSE_REGEN = 0;
public static final int CAUSE_EATING = 1;
public static final int CAUSE_MAGIC = 2;
public static final int CAUSE_CUSTOM = 3;
private float amount;
private final int reason;
public EntityRegainHealthEvent(Entity entity, float amount, int regainReason) {
this.entity = entity;
this.amount = amount;
this.reason = regainReason;
}
public float getAmount() {
return amount;
}
public void setAmount(float amount) {
this.amount = amount;
}
public int getRegainReason() {
return reason;
}
}