net.minecraft.entity

## Class EntityLiving

- java.lang.Object
- - net.minecraft.entity.Entity
  - - net.minecraft.entity.EntityLivingBase
    - - net.minecraft.entity.EntityLiving

- Direct Known Subclasses:
    EntityAmbientCreature, EntityCreature, EntityDragon, EntityFlying, EntitySlime

      public abstract class EntityLiving
      extends EntityLivingBase

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `experienceValue` The experience points the Entity gives.
    `int` | `livingSoundTime` Number of ticks since this EntityLiving last produced its sound
    `EntityAITasks` | `targetTasks`
    `EntityAITasks` | `tasks`

    - ### Fields inherited from class net.minecraft.entity.EntityLivingBase

      `arrowHitTimer, attackedAtYaw, attackTime, cameraPitch, deathTime, field_70769_ao, field_70770_ap, hurtTime, isSwingInProgress, jumpMovementFactor, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, moveForward, moveStrafing, prevCameraPitch, prevHealth, prevLimbSwingAmount, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, renderYawOffset, rotationYawHead, swingProgress, swingProgressInt`

    - ### Fields inherited from class net.minecraft.entity.Entity

      `addedToChunk, boundingBox, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, fireResistance, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, noClip, onGround, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EntityLiving(World par1World)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `allowLeashing()`
    `boolean` | `canAttackClass(Class par1Class)` Returns true if this entity can attack entities of the specified class.
    `boolean` | `canBeSteered()` returns true if all the conditions for steering the entity are met.
    `boolean` | `canPickUpLoot()`
    `void` | `clearLeashed(boolean par1, boolean par2)` Removes the leash from this entity.
    `void` | `eatGrassBonus()` This function applies the benefits of growing back wool and faster growing up to the acting entity.
    `void` | `faceEntity(Entity par1Entity, float par2, float par3)` Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument.
    `void` | `func_110163_bv()`
    `ItemStack` | `func_130225_q(int par1)`
    `boolean` | `getAlwaysRenderNameTag()`
    `boolean` | `getAlwaysRenderNameTagForRender()`
    `static Item` | `getArmorItemForSlot(int par0, int par1)` Params: Armor slot, Item tier
    `static int` | `getArmorPosition(ItemStack par0ItemStack)`
    `EntityLivingBase` | `getAttackTarget()` Gets the active target the Task system uses for tracking
    `boolean` | `getCanSpawnHere()` Checks if the entity's current position is a valid location to spawn this entity.
    `ItemStack` | `getCurrentItemOrArmor(int par1)` 0 = item, 1-n is armor
    `String` | `getCustomNameTag()`
    `String` | `getEntityName()` Gets the username of the entity.
    `EntitySenses` | `getEntitySenses()` returns the EntitySenses Object for the EntityLiving
    `ItemStack` | `getHeldItem()` Returns the item that this EntityLiving is holding, if any.
    `EntityJumpHelper` | `getJumpHelper()`
    `ItemStack[]` | `getLastActiveItems()`
    `boolean` | `getLeashed()`
    `Entity` | `getLeashedToEntity()`
    `EntityLookHelper` | `getLookHelper()`
    `int` | `getMaxSafePointTries()` The number of iterations PathFinder.getSafePoint will execute before giving up.
    `int` | `getMaxSpawnedInChunk()` Will return how many at most can spawn in a chunk at once.
    `EntityMoveHelper` | `getMoveHelper()`
    `PathNavigate` | `getNavigator()`
    `float` | `getRenderSizeModifier()` Returns render size modifier
    `int` | `getTalkInterval()` Get number of ticks, at least during which the living entity will be silent.
    `int` | `getVerticalFaceSpeed()` The speed it takes to move the entityliving's rotationPitch through the faceEntity method.
    `boolean` | `hasCustomNameTag()`
    `boolean` | `interactFirst(EntityPlayer par1EntityPlayer)` First layer of player interaction
    `boolean` | `isNoDespawnRequired()`
    `void` | `onEntityUpdate()` Gets called every tick from main Entity class
    `void` | `onLivingUpdate()` Called frequently so the entity can update its state every tick as required.
    `EntityLivingData` | `onSpawnWithEgg(EntityLivingData par1EntityLivingData)`
    `void` | `onUpdate()` Called to update the entity's position/logic.
    `void` | `playLivingSound()` Plays living's sound at its position
    `void` | `readEntityFromNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to read subclass entity data from NBT.
    `void` | `setAIMoveSpeed(float par1)` set the movespeed used for the new AI system
    `void` | `setAlwaysRenderNameTag(boolean par1)`
    `void` | `setAttackTarget(EntityLivingBase par1EntityLivingBase)` Sets the active target the Task system uses for tracking
    `void` | `setCanPickUpLoot(boolean par1)`
    `void` | `setCurrentItemOrArmor(int par1, ItemStack par2ItemStack)` Sets the held item, or an armor slot.
    `void` | `setCustomNameTag(String par1Str)`
    `void` | `setEquipmentDropChance(int par1, float par2)`
    `void` | `setLeashedToEntity(Entity par1Entity, boolean par2)` Sets the entity to be leashed to.\nArgs:\n@param par1Entity: The entity to be tethered to.\n@param par2: Whether to send an attaching notification packet to surrounding players.
    `void` | `setMoveForward(float par1)`
    `void` | `spawnExplosionParticle()` Spawns an explosion particle around the Entity's location
    `void` | `writeEntityToNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to write subclass entity data to NBT.

    - ### Methods inherited from class net.minecraft.entity.EntityLivingBase

      `addPotionEffect, attackEntityAsMob, attackEntityFrom, canBeCollidedWith, canBePushed, canBreatheUnderwater, canEntityBeSeen, clearActivePotions, curePotionEffects, dismountEntity, func_110142_aN, func_142015_aE, func_94060_bK, getAbsorptionAmount, getActivePotionEffect, getActivePotionEffects, getAge, getAIMoveSpeed, getAITarget, getArrowCountInEntity, getAttributeMap, getCreatureAttribute, getEntityAttribute, getEyeHeight, getHealth, getItemIcon, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getPosition, getRNG, getRotationYawHead, getSwingProgress, getTeam, getTotalArmorValue, handleHealthUpdate, heal, isChild, isClientWorld, isEntityAlive, isEntityUndead, isOnLadder, isOnSameTeam, isOnTeam, isPlayerSleeping, isPotionActive, isPotionActive, isPotionApplicable, knockBack, moveEntityWithHeading, onDeath, onItemPickup, performHurtAnimation, rayTrace, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, setAbsorptionAmount, setArrowCountInEntity, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setPositionAndUpdate, setRevengeTarget, setRotationYawHead, setSprinting, shouldRiderFaceForward, swingItem, updateRidden`

    - ### Methods inherited from class net.minecraft.entity.Entity

      `addEntityCrashInfo, addToPlayerScore, addVelocity, applyEntityCollision, canAttackWithItem, canRenderOnFire, canRiderInteract, copyDataFrom, copyLocationAndAnglesFrom, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAir, getBlockExplosionResistance, getBoundingBox, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBox, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityData, getExtendedProperties, getMaxInPortalTime, getMountedYOffset, getParts, getPersistentID, getPickedResult, getPortalCooldown, getShadowSize, getTeleportDirection, getTranslatedEntityName, getUniqueID, getYOffset, handleLavaMovement, handleWaterMovement, hashCode, hitByEntity, isBurning, isCreatureType, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToFire, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isOffsetPositionInLiquid, isPushedByWater, isRiding, isSneaking, isSprinting, isWet, mountEntity, moveEntity, moveFlying, onChunkLoad, onCollideWithPlayer, onKillEntity, onStruckByLightning, playSound, readFromNBT, registerExtendedProperties, resetEntityId, setAir, setAngles, setDead, setEating, setFire, setInPortal, setInvisible, setInWeb, setLocationAndAngles, setPosition, setPositionAndRotation, setSneaking, setVelocity, setWorld, shouldDismountInWater, shouldExplodeBlock, shouldRenderInPass, shouldRiderSit, toString, travelToDimension, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptional`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### livingSoundTime

          public int livingSoundTime

      Number of ticks since this EntityLiving last produced its sound

    - #### experienceValue

          public int experienceValue

      The experience points the Entity gives.

    - #### tasks

          public final EntityAITasks tasks

    - #### targetTasks

          public final EntityAITasks targetTasks

  - ### Constructor Detail

    - #### EntityLiving

          public EntityLiving(World par1World)

  - ### Method Detail

    - #### getLookHelper

          public EntityLookHelper getLookHelper()

    - #### getMoveHelper

          public EntityMoveHelper getMoveHelper()

    - #### getJumpHelper

          public EntityJumpHelper getJumpHelper()

    - #### getNavigator

          public PathNavigate getNavigator()

    - #### getEntitySenses

          public EntitySenses getEntitySenses()

      returns the EntitySenses Object for the EntityLiving

    - #### getAttackTarget

          public EntityLivingBase getAttackTarget()

      Gets the active target the Task system uses for tracking

    - #### setAttackTarget

          public void setAttackTarget(EntityLivingBase par1EntityLivingBase)

      Sets the active target the Task system uses for tracking

    - #### canAttackClass

          public boolean canAttackClass(Class par1Class)

      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

    - #### onEntityUpdate

          public void onEntityUpdate()

      Gets called every tick from main Entity class
      Overrides:
        `onEntityUpdate` in class `EntityLivingBase`

    - #### spawnExplosionParticle

          public void spawnExplosionParticle()

      Spawns an explosion particle around the Entity's location

    - #### onUpdate

          public void onUpdate()

      Called to update the entity's position/logic.
      Overrides:
        `onUpdate` in class `EntityLivingBase`

    - #### writeEntityToNBT

          public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to write subclass entity data to NBT.
      Overrides:
        `writeEntityToNBT` in class `EntityLivingBase`

    - #### readEntityFromNBT

          public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to read subclass entity data from NBT.
      Overrides:
        `readEntityFromNBT` in class `EntityLivingBase`

    - #### setMoveForward

          public void setMoveForward(float par1)

    - #### setAIMoveSpeed

          public void setAIMoveSpeed(float par1)

      set the movespeed used for the new AI system
      Overrides:
        `setAIMoveSpeed` in class `EntityLivingBase`

    - #### onLivingUpdate

          public void onLivingUpdate()

      Called frequently so the entity can update its state every tick as required. For example, zombies and skeletons use this to react to sunlight and start to burn.
      Overrides:
        `onLivingUpdate` in class `EntityLivingBase`

    - #### 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 par1Entity,
                        float par2,
                        float par3)

      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.

    - #### 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.

    - #### getMaxSafePointTries

          public int getMaxSafePointTries()

      The number of iterations PathFinder.getSafePoint will execute before giving up.
      Overrides:
        `getMaxSafePointTries` in class `Entity`

    - #### getHeldItem

          public ItemStack getHeldItem()

      Returns the item that this EntityLiving is holding, if any.
      Specified by:
        `getHeldItem` in class `EntityLivingBase`

    - #### getCurrentItemOrArmor

          public ItemStack getCurrentItemOrArmor(int par1)

      0 = item, 1-n is armor
      Specified by:
        `getCurrentItemOrArmor` in class `EntityLivingBase`

    - #### func_130225_q

          public ItemStack func_130225_q(int par1)

    - #### setCurrentItemOrArmor

          public void setCurrentItemOrArmor(int par1,
                                   ItemStack par2ItemStack)

      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`

    - #### getLastActiveItems

          public ItemStack[] getLastActiveItems()

      Specified by:
        `getLastActiveItems` in class `EntityLivingBase`

    - #### getArmorPosition

          public static int getArmorPosition(ItemStack par0ItemStack)

    - #### getArmorItemForSlot

          public static Item getArmorItemForSlot(int par0,
                                 int par1)

      Params: Armor slot, Item tier

    - #### onSpawnWithEgg

          public EntityLivingData onSpawnWithEgg(EntityLivingData par1EntityLivingData)

    - #### 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

    - #### getEntityName

          public String getEntityName()

      Gets the username of the entity.
      Overrides:
        `getEntityName` in class `Entity`

    - #### func_110163_bv

          public void func_110163_bv()

    - #### setCustomNameTag

          public void setCustomNameTag(String par1Str)

    - #### getCustomNameTag

          public String getCustomNameTag()

    - #### hasCustomNameTag

          public boolean hasCustomNameTag()

    - #### setAlwaysRenderNameTag

          public void setAlwaysRenderNameTag(boolean par1)

    - #### getAlwaysRenderNameTag

          public boolean getAlwaysRenderNameTag()

    - #### getAlwaysRenderNameTagForRender

          public boolean getAlwaysRenderNameTagForRender()

      Overrides:
        `getAlwaysRenderNameTagForRender` in class `EntityLivingBase`

    - #### setEquipmentDropChance

          public void setEquipmentDropChance(int par1,
                                    float par2)

    - #### canPickUpLoot

          public boolean canPickUpLoot()

    - #### setCanPickUpLoot

          public void setCanPickUpLoot(boolean par1)

    - #### isNoDespawnRequired

          public boolean isNoDespawnRequired()

    - #### interactFirst

          public final boolean interactFirst(EntityPlayer par1EntityPlayer)

      First layer of player interaction
      Overrides:
        `interactFirst` in class `Entity`

    - #### clearLeashed

          public void clearLeashed(boolean par1,
                          boolean par2)

      Removes the leash from this entity. Second parameter tells whether to send a packet to surrounding players.

    - #### allowLeashing

          public boolean allowLeashing()

    - #### getLeashed

          public boolean getLeashed()

    - #### getLeashedToEntity

          public Entity getLeashedToEntity()

    - #### setLeashedToEntity

          public void setLeashedToEntity(Entity par1Entity,
                                boolean par2)

      Sets the entity to be leashed to.\nArgs:\n@param par1Entity: The entity to be tethered to.\n@param par2: Whether to send an attaching notification packet to surrounding players.