类 EntityDeathEvent

直接已知子类:
PlayerDeathEvent

public class EntityDeathEvent extends EntityEvent
当一个实体死亡时触发本事件
  • 构造器详细资料

  • 方法详细资料

    • getEntity

      @NotNull public @NotNull LivingEntity getEntity()
      从类复制的说明: EntityEvent
      返回这个事件所涉及的实体.

      原文: Returns the Entity involved in this event

      覆盖:
      getEntity 在类中 EntityEvent
      返回:
      涉及这个事件的实体
    • getDamageSource

      @NotNull public @NotNull DamageSource getDamageSource()
      获取造成此实体死亡的伤害来源.

      原文:Gets the source of damage which caused the death.

      返回:
      造成此实体死亡的伤害来源
    • getDroppedExp

      public int getDroppedExp()
      返回这个死亡的实体掉落的经验数量.

      这不表明这个实体有多少经验值,而是它死亡时应该被创建多少掉落的经验值.

      原文: Gets how much EXP should be dropped from this death.

      This does not indicate how much EXP should be taken from the entity in question, merely how much should be created after its death.

      返回:
      返回掉落的经验值数量
    • setDroppedExp

      public void setDroppedExp(int exp)
      设置这个实体死亡所掉落的经验值数量.

      这不表明这个实体有多少经验值,而是它死亡时应该被创建多少掉落的经验值.

      原文:Sets how much EXP should be dropped from this death.

      This does not indicate how much EXP should be taken from the entity in question, merely how much should be created after its death.

      参数:
      exp - 掉落的经验值的数量
    • getDrops

      @NotNull public @NotNull List<ItemStack> getDrops()
      返回这实体死亡掉落物品的集合.

      原文:Gets all the items which will drop when the entity dies

      返回:
      死亡时所掉落的所有物品
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      指定者:
      getHandlers 在类中 Event
    • getHandlerList

      @NotNull public static @NotNull HandlerList getHandlerList()