EntityRegainHealthEvent
EntityRegainHealthEvent
=> org.bukkit.event.Event
=> org.bukkit.event.entity.EntityEvent
=> org.bukkit.event.entity.EntityRegainHealthEvent
Stores data for health-regain events本事件存储了实体回复血量时的有关数据。译注:事件不是用来完成数据的持久化存储的。此处所谓“存储”意为事件的字段中含有一些与涉事实体有关的信息,该事件从服务端底层得到这些信息,存储于一些字段中,再给插件进行读取。当插件处理完毕以后,事件对象应该被销毁。不能使用事件对象来对数据进行保存。
方法声明: public double getAmount()
方法签名: ()D
Gets the amount of regained health@return The amount of health regained该方法用于获取涉事实体生命值的回复量。@return 涉事实体生命值的回复量。
方法声明: public void setAmount(double amount)
方法签名: (D)V
Sets the amount of regained health@param amount the amount of health the entity will regain该方法用于设置涉事实体生命值的回复量。@param amount 涉事实体生命值的回复量。
方法声明: public boolean isCancelled()
方法签名: ()Z
方法声明: public void setCancelled(boolean cancel)
方法签名: (Z)V
方法声明: public RegainReason getRegainReason()
方法签名: ()Lorg/bukkit/event/entity/EntityRegainHealthEvent/RegainReason;
Gets the reason for why the entity is regaining health@return A RegainReason detailing the reason for the entity regaininghealth该方法用于获取实体回复血量的原因。@return 一个RegainReason
枚举字段,用于确定实体回复血量的详细原因。
方法声明: public HandlerList getHandlers()
方法签名: ()Lorg/bukkit/event/HandlerList;
方法声明: public static HandlerList getHandlerList()
方法签名: ()Lorg/bukkit/event/HandlerList;
An enum to specify the type of health regaining that is occurring用于确定实体回复血量原因的枚举。
When a player regains health from regenerating due to Peaceful mode(difficulty=0)游戏难度为和平,因而玩家回血。译注:凋零每秒的自动回血效果也归入此字段。
When a player regains health from regenerating due to their hungerbeing satisfied玩家饱食度与饱和度充足,因而回血。
When a player regains health from eating consumables玩家服用食物或药剂,因而回血。译注:本字段主要适用于非玩家实体服用食物直接回血的情况,比如马吃草料、狼吃骨头。上述生物没有饱食度机制,吃下食物即直接回血。
When an ender dragon regains health from an ender crystal末影水晶为末影龙增加血量。
When a player is healed by a potion or spell玩家被瞬时药水效果治愈。
When a player is healed over time by a potion or spell玩家拥有生命恢复等药水效果,随时间推移缓慢被治愈。
When a wither is filling its health during spawning凋零在被召唤的过程中血量自零开始不断增加。
When an entity is damaged by the Wither potion effect实体因凋零效果而受到伤害。
Any other reason not covered by the reasons above未被上述分类囊括的原因。
Last modified 1mo ago