Class EntityLiving

    • Field Detail

      • livingSoundTime

        public int livingSoundTime
      • experienceValue

        protected int experienceValue
      • equipmentDropChances

        protected float[] equipmentDropChances
        + Chances for each equipment piece from dropping when this entity dies.
    • Constructor Detail

      • EntityLiving

        public EntityLiving​(World worldIn)
    • Method Detail

      • getAttackTarget

        public EntityLivingBase getAttackTarget()
        + Gets the active target the Task system uses for tracking
      • setAttackTarget

        public void setAttackTarget​(EntityLivingBase entitylivingbaseIn)
        + Sets the active target the Task system uses for tracking
      • canAttackClass

        public boolean canAttackClass​(java.lang.Class<? extends EntityLivingBase> cls)
        + Returns true if this entity can attack entities of the specified class.
      • eatGrassBonus

        public void eatGrassBonus()
        + This function applies the benefits of growing back wool and faster growing up to the acting entity. (This function is used in the AIEatGrass)
      • getTalkInterval

        public int getTalkInterval()
        + Get number of ticks, at least during which the living entity will be silent.
      • playLivingSound

        public void playLivingSound()
        + Plays living's sound at its position
      • spawnExplosionParticle

        public void spawnExplosionParticle()
        + Spawns an explosion particle around the Entity's location
      • getLivingSound

        protected java.lang.String getLivingSound()
        + Returns the sound this mob makes while it's alive.
      • getDropItem

        protected Item getDropItem()
      • dropFewItems

        protected void dropFewItems​(boolean var1,
                                    int i)
        + Drop 0-2 items of this living's type
        Overrides:
        dropFewItems in class EntityLivingBase
      • setMoveForward

        public void setMoveForward​(float parFloat1)
      • setAIMoveSpeed

        public void setAIMoveSpeed​(float f)
        + set the movespeed used for the new AI system
        Overrides:
        setAIMoveSpeed in class EntityLivingBase
      • updateEquipmentIfNeeded

        protected void updateEquipmentIfNeeded​(EntityItem itemEntity)
        + Tests if this entity should pickup a weapon or an armor. Entity drops current weapon or armor if the new one is better.
      • func_175448_a

        protected boolean func_175448_a​(ItemStack stack)
      • canDespawn

        protected boolean canDespawn()
        + Determines if an entity can be despawned, used on idle far away entities
      • despawnEntity

        protected void despawnEntity()
        + Makes the entity despawn if requirements are reached
      • updateAITasks

        protected void updateAITasks()
      • getVerticalFaceSpeed

        public int getVerticalFaceSpeed()
        + The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently use in wolves.
      • faceEntity

        public void faceEntity​(Entity entityIn,
                               float parFloat1,
                               float parFloat2)
        + Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument.
      • getCanSpawnHere

        public boolean getCanSpawnHere()
        + Checks if the entity's current position is a valid location to spawn this entity.
      • isNotColliding

        public boolean isNotColliding()
        + Checks that the entity is not colliding with any blocks / liquids
      • getRenderSizeModifier

        public float getRenderSizeModifier()
        + Returns render size modifier
      • getMaxSpawnedInChunk

        public int getMaxSpawnedInChunk()
        + Will return how many at most can spawn in a chunk at once.
      • getMaxFallHeight

        public int getMaxFallHeight()
        + The maximum height from where the entity is alowed to jump (used in pathfinder)
        Overrides:
        getMaxFallHeight in class Entity
      • setCurrentItemOrArmor

        public void setCurrentItemOrArmor​(int i,
                                          ItemStack itemstack)
        + Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot
        Specified by:
        setCurrentItemOrArmor in class EntityLivingBase
      • dropEquipment

        protected void dropEquipment​(boolean flag,
                                     int i)
        + Drop the equipment for this entity.
        Overrides:
        dropEquipment in class EntityLivingBase
      • setEquipmentBasedOnDifficulty

        protected void setEquipmentBasedOnDifficulty​(DifficultyInstance difficulty)
        + Gives armor or weapon for entity based on given DifficultyInstance
      • getArmorPosition

        public static int getArmorPosition​(ItemStack stack)
      • getArmorItemForSlot

        public static Item getArmorItemForSlot​(int armorSlot,
                                               int itemTier)
        + Gets the vanilla armor Item that can go in the slot specified for the given tier.
      • setEnchantmentBasedOnDifficulty

        protected void setEnchantmentBasedOnDifficulty​(DifficultyInstance difficulty)
        + Enchants Entity's current equipments based on given DifficultyInstance
      • onInitialSpawn

        public IEntityLivingData onInitialSpawn​(DifficultyInstance difficulty,
                                                IEntityLivingData livingdata)
        + Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called when entity is reloaded from nbt. Mainly used for initializing attributes and inventory
      • canBeSteered

        public boolean canBeSteered()
        + returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden by a player and the player is holding a carrot-on-a-stick
      • enablePersistence

        public void enablePersistence()
        + Enable the Entity persistence
      • setEquipmentDropChance

        public void setEquipmentDropChance​(int slotIn,
                                           float chance)
      • canPickUpLoot

        public boolean canPickUpLoot()
      • setCanPickUpLoot

        public void setCanPickUpLoot​(boolean canPickup)
      • isNoDespawnRequired

        public boolean isNoDespawnRequired()
      • interactFirst

        public final boolean interactFirst​(EntityPlayer entityplayer)
        + First layer of player interaction
        Overrides:
        interactFirst in class Entity
      • interact

        protected boolean interact​(EntityPlayer var1)
        + Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
      • updateLeashedState

        protected void updateLeashedState()
        + Applies logic related to leashes, for example dragging the entity or breaking the leash.
      • clearLeashed

        public void clearLeashed​(boolean sendPacket,
                                 boolean dropLead)
        + Removes the leash from this entity
      • allowLeashing

        public boolean allowLeashing()
      • getLeashed

        public boolean getLeashed()
      • getLeashedToEntity

        public Entity getLeashedToEntity()
      • setLeashedToEntity

        public void setLeashedToEntity​(Entity entityIn,
                                       boolean sendAttachNotification)
        + Sets the entity to be leashed to.
      • isServerWorld

        public boolean isServerWorld()
        + Returns whether the entity is in a server world
        Overrides:
        isServerWorld in class EntityLivingBase
      • setNoAI

        public void setNoAI​(boolean disable)
        + Set whether this Entity's AI is disabled
      • isAIDisabled

        public boolean isAIDisabled()
        + Get whether this Entity's AI is disabled