Class EntitySwimmingAnimal

All Implemented Interfaces:
LogicalUtils, EntityAgeable, EntityAsyncPrepare, EntityDamageable, EntityNameable, Metadatable, Cloneable
Direct Known Subclasses:
EntityAxolotl, EntityCod, EntityDolphin, EntityGlowSquid, EntityPufferfish, EntitySalmon, EntitySquid, EntityTadpole, EntityTropicalFish

@PowerNukkitXOnly @Since("1.6.0.0-PNX") public abstract class EntitySwimmingAnimal extends EntityAnimal
水中游泳动物
  • Constructor Details

  • Method Details

    • 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 EntityIntelligent
      Parameters:
      source - 记录伤害源的事件
      Record the event of the source of the attack
      Returns:
      是否攻击成功
      Whether the attack was successful
    • handleGravity

      protected void handleGravity()
      Overrides:
      handleGravity in class EntityPhysical
    • getGravity

      public float getGravity()
      Overrides:
      getGravity in class EntityPhysical
    • handleFrictionMovement

      protected void handleFrictionMovement()
      Overrides:
      handleFrictionMovement in class EntityPhysical
    • handleFloatingMovement

      protected void handleFloatingMovement()
      Overrides:
      handleFloatingMovement in class EntityPhysical
    • updateMovement

      public void updateMovement()
      Overrides:
      updateMovement in class EntityPhysical
    • getMovementSpeedAtBlock

      public float getMovementSpeedAtBlock(Block block)
      Description copied from class: EntityPhysical
      获取实体在某方块处行走的真实速度,此方法会考虑流体阻力
      Overrides:
      getMovementSpeedAtBlock in class EntityPhysical
      Parameters:
      block - 实体所在的方块,不是脚下的方块
      Returns:
      在某方块处行走的真实速度