Class EntityAnimal

All Implemented Interfaces:
EntityControlUtils, LogicalUtils, EntityAgeable, EntityAsyncPrepare, EntityDamageable, EntityNameable, Metadatable, Cloneable
Direct Known Subclasses:
EntityAllay, EntityAxolotl, EntityBat, EntityBee, EntityCamel, EntityCat, EntityChicken, EntityCow, EntityDolphin, EntityDonkey, EntityFish, EntityFox, EntityFrog, EntityGlowSquid, EntityGoat, EntityHorse, EntityLlama, EntityMooshroom, EntityMule, EntityOcelot, EntityPanda, EntityParrot, EntityPig, EntityPolarBear, EntityPufferfish, EntityRabbit, EntitySheep, EntitySkeletonHorse, EntitySquid, EntityStrider, EntityTadpole, EntityTameable, EntityTurtle, EntityWolf, EntityZombieHorse

public abstract class EntityAnimal extends EntityIntelligent
Author:
MagicDroidX (Nukkit Project)
  • Constructor Details

  • Method Details

    • initEntity

      protected void initEntity()
      Description copied from class: Entity
      实体初始化顺序,先初始化Entity类字段->Entity构造函数->进入init方法->调用initEntity方法->子类字段初始化->子类构造函数

      用于初始化实体的NBT和实体字段的方法

      Entity initialization order, first initialize the Entity class field->Entity constructor->Enter the init method->Call the init Entity method-> subclass field initialization-> subclass constructor

      The method used to initialize the NBT and entity fields of the entity

      Overrides:
      initEntity in class EntityIntelligent
    • saveNBT

      public void saveNBT()
      Overrides:
      saveNBT in class EntityIntelligent
    • onInteract

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

      protected void sendBreedingAnimation(Item item)
    • isBreedingItem

      public boolean isBreedingItem(Item item)
      可以导致繁殖的喂养物品

      Feeding items that can lead to reproduction.

      Parameters:
      item - 物品
      Returns:
      boolean 是否可以导致繁殖
      Whether it can lead to reproduction
    • getStepHeight

      protected double getStepHeight()
      Overrides:
      getStepHeight in class Entity