Class EntityZombie

All Implemented Interfaces:
EntityControlUtils, LogicalUtils, EntityAgeable, EntityAsyncPrepare, EntityCanAttack, EntityDamageable, EntityNameable, EntitySmite, EntityWalkable, EntityInventoryHolder, InventoryHolder, Metadatable, Cloneable
Direct Known Subclasses:
EntityHusk

public class EntityZombie extends EntityMob implements EntityWalkable, EntitySmite
Since:
4/23/2017
Author:
Dr. Nick Doran
  • Field Details

  • Constructor Details

  • Method Details

    • requireBehaviorGroup

      public IBehaviorGroup requireBehaviorGroup()
      Description copied from class: EntityIntelligent
      请求一个行为组实例,此方法在实体初始化行为组时调用
      Overrides:
      requireBehaviorGroup in class EntityIntelligent
      Returns:
      新创建的行为组
    • getNetworkId

      public int getNetworkId()
      Description copied from class: Entity
      获得该实体的网络ID

      Get the network ID of the entity

      Specified by:
      getNetworkId in class Entity
      Returns:
      the network id
    • initEntity

      protected void initEntity()
      Overrides:
      initEntity in class EntityMob
    • getWidth

      public float getWidth()
      Overrides:
      getWidth in class Entity
    • getHeight

      public float getHeight()
      Description copied from class: Entity
      实体高度

      entity Height

      Overrides:
      getHeight in class Entity
      Returns:
      the height
    • getOriginalName

      @PowerNukkitOnly @Since("1.5.1.0-PN") public String getOriginalName()
      Description copied from class: Entity
      The name that English name of the type of this entity.
      Overrides:
      getOriginalName in class Entity
    • isUndead

      @PowerNukkitOnly public boolean isUndead()
      Overrides:
      isUndead in class Entity
    • isPreventingSleep

      @PowerNukkitOnly public boolean isPreventingSleep(Player player)
      Overrides:
      isPreventingSleep in class Entity
    • onUpdate

      @PowerNukkitXOnly public boolean onUpdate(int currentTick)
      Overrides:
      onUpdate in class EntityMob
    • getFloatingForceFactor

      @Since("1.19.60-r1") public double getFloatingForceFactor()
      Description copied from class: EntityPhysical
      浮力系数
      示例:
       if (hasWaterAt(this.getFloatingHeight())) {//实体指定高度进入水中后实体上浮
           return 1.3;//因为浮力系数>1,该值越大上浮越快
       }
       return 0.7;//实体指定高度没进入水中,实体存在浮力会抵抗部分重力,但是不会上浮。
                  //因为浮力系数<1,该值最好和上值相加等于2,例 1.3+0.7=2
       
      Overrides:
      getFloatingForceFactor in class EntityPhysical
      Returns:
      the floating force factor
    • attack

      public boolean attack(EntityDamageEvent source)
      Description copied from class: Entity
      当一个实体被攻击时(即接受一个实体伤害事件 这个事件可以是由其他实体攻击导致,也可能是自然伤害)调用.

      Called when an entity is attacked (i.e. receives an entity damage event. This event can be caused by an attack by another entity, or it can be a natural damage).

      Overrides:
      attack in class EntityMob
      Parameters:
      source - 记录伤害源的事件
      Record the event of the source of the attack
      Returns:
      是否攻击成功
      Whether the attack was successful
    • getDrops

      public Item[] getDrops()
      Overrides:
      getDrops in class EntityLiving