Class EntityCreeper

All Implemented Interfaces:
EntityControlUtils, LogicalUtils, EntityAgeable, EntityAsyncPrepare, EntityCanAttack, EntityDamageable, EntityInteractable, EntityNameable, EntityWalkable, EntityInventoryHolder, InventoryHolder, Metadatable, Cloneable

public class EntityCreeper extends EntityMob implements EntityWalkable, EntityInteractable
Author:
Box.
  • 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
    • 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
    • getFloatingHeight

      @Since("1.19.60-r1") public float getFloatingHeight()
      Description copied from class: EntityPhysical
      获得浮动到的实体高度 , 0为实体底部 Entity.getCurrentHeight()为实体顶部
      例:
      值为0时,实体的脚接触水平面
      值为getCurrentHeight/2时,实体的中间部分接触水平面
      值为getCurrentHeight时,实体的头部接触水平面
      Overrides:
      getFloatingHeight in class EntityPhysical
      Returns:
      the float
    • isPowered

      public boolean isPowered()
    • setPowered

      public void setPowered(EntityLightningStrike bolt)
    • setPowered

      public void setPowered(boolean powered)
    • onStruckByLightning

      public void onStruckByLightning(Entity entity)
      Overrides:
      onStruckByLightning in class Entity
    • initEntity

      protected void initEntity()
      Overrides:
      initEntity in class EntityMob
    • 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
    • getDrops

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

      @PowerNukkitOnly public boolean isPreventingSleep(Player player)
      Overrides:
      isPreventingSleep in class Entity
    • 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
    • onInteract

      public boolean onInteract(Player player, Item item, Vector3 clickedPos)
      Specified by:
      onInteract in interface EntityNameable
      Overrides:
      onInteract in class EntityIntelligent
    • getInteractButtonText

      public String getInteractButtonText(Player player)
      Specified by:
      getInteractButtonText in interface EntityInteractable
    • canDoInteraction

      public boolean canDoInteraction()
      Specified by:
      canDoInteraction in interface EntityInteractable