net.minecraft.entity

## Class EntityLivingBase

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

- Direct Known Subclasses:
    EntityLiving, EntityPlayer

      public abstract class EntityLivingBase
      extends Entity

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `arrowHitTimer`
    `float` | `attackedAtYaw` The yaw at which this entity was last attacked from.
    `int` | `attackTime`
    `float` | `cameraPitch`
    `int` | `deathTime` The amount of time remaining this entity should act 'dead', i.e.
    `float` | `field_70769_ao`
    `float` | `field_70770_ap`
    `int` | `hurtTime` The amount of time remaining this entity should act 'hurt'.
    `boolean` | `isSwingInProgress` Whether an arm swing is currently in progress.
    `float` | `jumpMovementFactor` A factor used to determine how far this entity will move each tick if it is jumping or falling.
    `float` | `limbSwing` Only relevant when limbYaw is not 0(the entity is moving).
    `float` | `limbSwingAmount`
    `int` | `maxHurtResistantTime`
    `int` | `maxHurtTime` What the hurt time was max set to last.
    `float` | `moveForward`
    `float` | `moveStrafing`
    `float` | `prevCameraPitch`
    `float` | `prevHealth`
    `float` | `prevLimbSwingAmount`
    `float` | `prevRenderYawOffset`
    `float` | `prevRotationYawHead` Entity head rotation yaw at previous tick
    `float` | `prevSwingProgress`
    `float` | `renderYawOffset`
    `float` | `rotationYawHead` Entity head rotation yaw
    `float` | `swingProgress`
    `int` | `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
    `EntityLivingBase(World par1World)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addPotionEffect(PotionEffect par1PotionEffect)` adds a PotionEffect to the entity
    `boolean` | `attackEntityAsMob(Entity par1Entity)`
    `boolean` | `attackEntityFrom(DamageSource par1DamageSource, float par2)` Called when the entity is attacked.
    `boolean` | `canBeCollidedWith()` Returns true if other Entities should be prevented from moving through this Entity.
    `boolean` | `canBePushed()` Returns true if this entity should push and be pushed by other entities when colliding.
    `boolean` | `canBreatheUnderwater()`
    `boolean` | `canEntityBeSeen(Entity par1Entity)` returns true if the entity provided in the argument can be seen.
    `void` | `clearActivePotions()`
    `void` | `curePotionEffects(ItemStack curativeItem)` Removes all potion effects that have curativeItem as a curative item for its effect
    `void` | `dismountEntity(Entity par1Entity)` Moves the entity to a position out of the way of its mount.
    `CombatTracker` | `func_110142_aN()`
    `int` | `func_142015_aE()`
    `EntityLivingBase` | `func_94060_bK()`
    `float` | `getAbsorptionAmount()`
    `PotionEffect` | `getActivePotionEffect(Potion par1Potion)` returns the PotionEffect for the supplied Potion if it is active, null otherwise.
    `Collection` | `getActivePotionEffects()`
    `int` | `getAge()`
    `float` | `getAIMoveSpeed()` the movespeed used for the new AI system
    `EntityLivingBase` | `getAITarget()`
    `boolean` | `getAlwaysRenderNameTagForRender()`
    `int` | `getArrowCountInEntity()` counts the amount of arrows stuck in the entity.
    `BaseAttributeMap` | `getAttributeMap()`
    `EnumCreatureAttribute` | `getCreatureAttribute()` Get this Entity's EnumCreatureAttribute
    `abstract ItemStack` | `getCurrentItemOrArmor(int i)` 0 = item, 1-n is armor
    `AttributeInstance` | `getEntityAttribute(Attribute par1Attribute)`
    `float` | `getEyeHeight()`
    `float` | `getHealth()`
    `abstract ItemStack` | `getHeldItem()` Returns the item that this EntityLiving is holding, if any.
    `Icon` | `getItemIcon(ItemStack par1ItemStack, int par2)`
    `abstract ItemStack[]` | `getLastActiveItems()`
    `EntityLivingBase` | `getLastAttacker()`
    `int` | `getLastAttackerTime()`
    `Vec3` | `getLook(float par1)` interpolated look vector
    `Vec3` | `getLookVec()` returns a (normalized) vector of where this entity is looking
    `float` | `getMaxHealth()`
    `Vec3` | `getPosition(float par1)`
    `Random` | `getRNG()`
    `float` | `getRotationYawHead()`
    `float` | `getSwingProgress(float par1)`
    `Team` | `getTeam()`
    `int` | `getTotalArmorValue()` Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue
    `void` | `handleHealthUpdate(byte par1)`
    `void` | `heal(float par1)` Heal living entity (param: amount of half-hearts)
    `boolean` | `isChild()` If Animal, checks if the age timer is negative
    `boolean` | `isClientWorld()` Returns whether the entity is in a local (client) world
    `boolean` | `isEntityAlive()` Checks whether target entity is alive.
    `boolean` | `isEntityUndead()` Returns true if this entity is undead.
    `boolean` | `isOnLadder()` returns true if this entity is by a ladder, false otherwise
    `boolean` | `isOnSameTeam(EntityLivingBase par1EntityLivingBase)`
    `boolean` | `isOnTeam(Team par1Team)` Returns true if the entity is on a specific team.
    `boolean` | `isPlayerSleeping()` Returns whether player is sleeping or not
    `boolean` | `isPotionActive(int par1)`
    `boolean` | `isPotionActive(Potion par1Potion)`
    `boolean` | `isPotionApplicable(PotionEffect par1PotionEffect)`
    `void` | `knockBack(Entity par1Entity, float par2, double par3, double par5)` knocks back this entity
    `void` | `moveEntityWithHeading(float par1, float par2)` Moves the entity based on the specified heading.
    `void` | `onDeath(DamageSource par1DamageSource)` Called when the mob's health reaches 0.
    `void` | `onEntityUpdate()` Gets called every tick from main Entity class
    `void` | `onItemPickup(Entity par1Entity, int par2)` Called whenever an item is picked up from walking over it.
    `void` | `onLivingUpdate()` Called frequently so the entity can update its state every tick as required.
    `void` | `onUpdate()` Called to update the entity's position/logic.
    `void` | `performHurtAnimation()`
    `MovingObjectPosition` | `rayTrace(double par1, float par3)`
    `void` | `readEntityFromNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to read subclass entity data from NBT.
    `void` | `removePotionEffect(int par1)` Remove the specified potion effect from this entity.
    `void` | `removePotionEffectClient(int par1)` Remove the speified potion effect from this entity.
    `void` | `renderBrokenItemStack(ItemStack par1ItemStack)` Renders broken item particles using the given ItemStack
    `void` | `setAbsorptionAmount(float par1)`
    `void` | `setAIMoveSpeed(float par1)` set the movespeed used for the new AI system
    `void` | `setArrowCountInEntity(int par1)` sets the amount of arrows stuck in the entity.
    `abstract void` | `setCurrentItemOrArmor(int i, ItemStack itemstack)` Sets the held item, or an armor slot.
    `void` | `setHealth(float par1)`
    `void` | `setJumping(boolean par1)`
    `void` | `setLastAttacker(Entity par1Entity)`
    `void` | `setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)`
    `void` | `setPositionAndUpdate(double par1, double par3, double par5)` Move the entity to the coordinates informed, but keep yaw/pitch values.
    `void` | `setRevengeTarget(EntityLivingBase par1EntityLivingBase)`
    `void` | `setRotationYawHead(float par1)`
    `void` | `setSprinting(boolean par1)` Set sprinting switch for Entity.
    `boolean` | `shouldRiderFaceForward(EntityPlayer player)` Returns true if the entity's rider (EntityPlayer) should face forward when mounted.
    `void` | `swingItem()` Swings the item the player is holding.
    `void` | `updateRidden()` Handles updating while being ridden by an entity
    `void` | `writeEntityToNBT(NBTTagCompound par1NBTTagCompound)` (abstract) Protected helper method to write subclass entity data to NBT.

    - ### 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, getEntityName, getExtendedProperties, getMaxInPortalTime, getMaxSafePointTries, getMountedYOffset, getParts, getPersistentID, getPickedResult, getPortalCooldown, getShadowSize, getTeleportDirection, getTranslatedEntityName, getUniqueID, getYOffset, handleLavaMovement, handleWaterMovement, hashCode, hitByEntity, interactFirst, 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

    - #### isSwingInProgress

          public boolean isSwingInProgress

      Whether an arm swing is currently in progress.

    - #### swingProgressInt

          public int swingProgressInt

    - #### arrowHitTimer

          public int arrowHitTimer

    - #### prevHealth

          public float prevHealth

    - #### hurtTime

          public int hurtTime

      The amount of time remaining this entity should act 'hurt'. (Visual appearance of red tint)

    - #### maxHurtTime

          public int maxHurtTime

      What the hurt time was max set to last.

    - #### attackedAtYaw

          public float attackedAtYaw

      The yaw at which this entity was last attacked from.

    - #### deathTime

          public int deathTime

      The amount of time remaining this entity should act 'dead', i.e. have a corpse in the world.

    - #### attackTime

          public int attackTime

    - #### prevSwingProgress

          public float prevSwingProgress

    - #### swingProgress

          public float swingProgress

    - #### prevLimbSwingAmount

          public float prevLimbSwingAmount

    - #### limbSwingAmount

          public float limbSwingAmount

    - #### limbSwing

          public float limbSwing

      Only relevant when limbYaw is not 0(the entity is moving). Influences where in its swing legs and arms currently are.

    - #### maxHurtResistantTime

          public int maxHurtResistantTime

    - #### prevCameraPitch

          public float prevCameraPitch

    - #### cameraPitch

          public float cameraPitch

    - #### field_70769_ao

          public float field_70769_ao

    - #### field_70770_ap

          public float field_70770_ap

    - #### renderYawOffset

          public float renderYawOffset

    - #### prevRenderYawOffset

          public float prevRenderYawOffset

    - #### rotationYawHead

          public float rotationYawHead

      Entity head rotation yaw

    - #### prevRotationYawHead

          public float prevRotationYawHead

      Entity head rotation yaw at previous tick

    - #### jumpMovementFactor

          public float jumpMovementFactor

      A factor used to determine how far this entity will move each tick if it is jumping or falling.

    - #### moveStrafing

          public float moveStrafing

    - #### moveForward

          public float moveForward

  - ### Constructor Detail

    - #### EntityLivingBase

          public EntityLivingBase(World par1World)

  - ### Method Detail

    - #### canBreatheUnderwater

          public boolean canBreatheUnderwater()

    - #### onEntityUpdate

          public void onEntityUpdate()

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

    - #### isChild

          public boolean isChild()

      If Animal, checks if the age timer is negative

    - #### getRNG

          public Random getRNG()

    - #### getAITarget

          public EntityLivingBase getAITarget()

    - #### func_142015_aE

          public int func_142015_aE()

    - #### setRevengeTarget

          public void setRevengeTarget(EntityLivingBase par1EntityLivingBase)

    - #### getLastAttacker

          public EntityLivingBase getLastAttacker()

    - #### getLastAttackerTime

          public int getLastAttackerTime()

    - #### setLastAttacker

          public void setLastAttacker(Entity par1Entity)

    - #### getAge

          public int getAge()

    - #### writeEntityToNBT

          public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to write subclass entity data to NBT.

    - #### readEntityFromNBT

          public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)

      (abstract) Protected helper method to read subclass entity data from NBT.

    - #### clearActivePotions

          public void clearActivePotions()

    - #### getActivePotionEffects

          public Collection getActivePotionEffects()

    - #### isPotionActive

          public boolean isPotionActive(int par1)

    - #### isPotionActive

          public boolean isPotionActive(Potion par1Potion)

    - #### getActivePotionEffect

          public PotionEffect getActivePotionEffect(Potion par1Potion)

      returns the PotionEffect for the supplied Potion if it is active, null otherwise.

    - #### addPotionEffect

          public void addPotionEffect(PotionEffect par1PotionEffect)

      adds a PotionEffect to the entity

    - #### isPotionApplicable

          public boolean isPotionApplicable(PotionEffect par1PotionEffect)

    - #### isEntityUndead

          public boolean isEntityUndead()

      Returns true if this entity is undead.

    - #### removePotionEffectClient

          public void removePotionEffectClient(int par1)

      Remove the speified potion effect from this entity.

    - #### removePotionEffect

          public void removePotionEffect(int par1)

      Remove the specified potion effect from this entity.

    - #### heal

          public void heal(float par1)

      Heal living entity (param: amount of half-hearts)

    - #### getHealth

          public final float getHealth()

    - #### setHealth

          public void setHealth(float par1)

    - #### attackEntityFrom

          public boolean attackEntityFrom(DamageSource par1DamageSource,
                                 float par2)

      Called when the entity is attacked.
      Overrides:
        `attackEntityFrom` in class `Entity`

    - #### renderBrokenItemStack

          public void renderBrokenItemStack(ItemStack par1ItemStack)

      Renders broken item particles using the given ItemStack

    - #### onDeath

          public void onDeath(DamageSource par1DamageSource)

      Called when the mob's health reaches 0.

    - #### knockBack

          public void knockBack(Entity par1Entity,
                       float par2,
                       double par3,
                       double par5)

      knocks back this entity

    - #### isOnLadder

          public boolean isOnLadder()

      returns true if this entity is by a ladder, false otherwise

    - #### isEntityAlive

          public boolean isEntityAlive()

      Checks whether target entity is alive.
      Overrides:
        `isEntityAlive` in class `Entity`

    - #### performHurtAnimation

          public void performHurtAnimation()

      Overrides:
        `performHurtAnimation` in class `Entity`

    - #### getTotalArmorValue

          public int getTotalArmorValue()

      Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue

    - #### func_110142_aN

          public CombatTracker func_110142_aN()

    - #### func_94060_bK

          public EntityLivingBase func_94060_bK()

    - #### getMaxHealth

          public final float getMaxHealth()

    - #### getArrowCountInEntity

          public final int getArrowCountInEntity()

      counts the amount of arrows stuck in the entity. getting hit by arrows increases this, used in rendering

    - #### setArrowCountInEntity

          public final void setArrowCountInEntity(int par1)

      sets the amount of arrows stuck in the entity. used for rendering those

    - #### swingItem

          public void swingItem()

      Swings the item the player is holding.

    - #### handleHealthUpdate

          public void handleHealthUpdate(byte par1)

      Overrides:
        `handleHealthUpdate` in class `Entity`

    - #### getEntityAttribute

          public AttributeInstance getEntityAttribute(Attribute par1Attribute)

    - #### getAttributeMap

          public BaseAttributeMap getAttributeMap()

    - #### getCreatureAttribute

          public EnumCreatureAttribute getCreatureAttribute()

      Get this Entity's EnumCreatureAttribute

    - #### getHeldItem

          public abstract ItemStack getHeldItem()

      Returns the item that this EntityLiving is holding, if any.

    - #### getCurrentItemOrArmor

          public abstract ItemStack getCurrentItemOrArmor(int i)

      0 = item, 1-n is armor

    - #### setCurrentItemOrArmor

          public abstract 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
      Overrides:
        `setCurrentItemOrArmor` in class `Entity`

    - #### setSprinting

          public void setSprinting(boolean par1)

      Set sprinting switch for Entity.
      Overrides:
        `setSprinting` in class `Entity`

    - #### getLastActiveItems

          public abstract ItemStack[] getLastActiveItems()

      Overrides:
        `getLastActiveItems` in class `Entity`

    - #### setPositionAndUpdate

          public void setPositionAndUpdate(double par1,
                                  double par3,
                                  double par5)

      Move the entity to the coordinates informed, but keep yaw/pitch values.

    - #### dismountEntity

          public void dismountEntity(Entity par1Entity)

      Moves the entity to a position out of the way of its mount.

    - #### getAlwaysRenderNameTagForRender

          public boolean getAlwaysRenderNameTagForRender()

    - #### getItemIcon

          public Icon getItemIcon(ItemStack par1ItemStack,
                         int par2)

    - #### moveEntityWithHeading

          public void moveEntityWithHeading(float par1,
                                   float par2)

      Moves the entity based on the specified heading. Args: strafe, forward

    - #### getAIMoveSpeed

          public float getAIMoveSpeed()

      the movespeed used for the new AI system

    - #### setAIMoveSpeed

          public void setAIMoveSpeed(float par1)

      set the movespeed used for the new AI system

    - #### attackEntityAsMob

          public boolean attackEntityAsMob(Entity par1Entity)

    - #### isPlayerSleeping

          public boolean isPlayerSleeping()

      Returns whether player is sleeping or not

    - #### onUpdate

          public void onUpdate()

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

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

    - #### updateRidden

          public void updateRidden()

      Handles updating while being ridden by an entity
      Overrides:
        `updateRidden` in class `Entity`

    - #### setPositionAndRotation2

          public void setPositionAndRotation2(double par1,
                                     double par3,
                                     double par5,
                                     float par7,
                                     float par8,
                                     int par9)

      Overrides:
        `setPositionAndRotation2` in class `Entity`

    - #### setJumping

          public void setJumping(boolean par1)

    - #### onItemPickup

          public void onItemPickup(Entity par1Entity,
                          int par2)

      Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize

    - #### canEntityBeSeen

          public boolean canEntityBeSeen(Entity par1Entity)

      returns true if the entity provided in the argument can be seen. (Raytrace)

    - #### getLookVec

          public Vec3 getLookVec()

      returns a (normalized) vector of where this entity is looking
      Overrides:
        `getLookVec` in class `Entity`

    - #### getLook

          public Vec3 getLook(float par1)

      interpolated look vector

    - #### getSwingProgress

          public float getSwingProgress(float par1)

    - #### getPosition

          public Vec3 getPosition(float par1)

    - #### rayTrace

          public MovingObjectPosition rayTrace(double par1,
                                      float par3)

    - #### isClientWorld

          public boolean isClientWorld()

      Returns whether the entity is in a local (client) world

    - #### canBeCollidedWith

          public boolean canBeCollidedWith()

      Returns true if other Entities should be prevented from moving through this Entity.
      Overrides:
        `canBeCollidedWith` in class `Entity`

    - #### canBePushed

          public boolean canBePushed()

      Returns true if this entity should push and be pushed by other entities when colliding.
      Overrides:
        `canBePushed` in class `Entity`

    - #### getEyeHeight

          public float getEyeHeight()

      Overrides:
        `getEyeHeight` in class `Entity`

    - #### getRotationYawHead

          public float getRotationYawHead()

      Overrides:
        `getRotationYawHead` in class `Entity`

    - #### setRotationYawHead

          public void setRotationYawHead(float par1)

      Overrides:
        `setRotationYawHead` in class `Entity`

    - #### getAbsorptionAmount

          public float getAbsorptionAmount()

    - #### setAbsorptionAmount

          public void setAbsorptionAmount(float par1)

    - #### getTeam

          public Team getTeam()

    - #### isOnSameTeam

          public boolean isOnSameTeam(EntityLivingBase par1EntityLivingBase)

    - #### isOnTeam

          public boolean isOnTeam(Team par1Team)

      Returns true if the entity is on a specific team.

    - #### curePotionEffects

          public void curePotionEffects(ItemStack curativeItem)

      Removes all potion effects that have curativeItem as a curative item for its effect
      Parameters:
        `curativeItem` - The itemstack we are using to cure potion effects

    - #### shouldRiderFaceForward

          public boolean shouldRiderFaceForward(EntityPlayer player)

      Returns true if the entity's rider (EntityPlayer) should face forward when mounted. currently only used in vanilla code by pigs.
      Parameters:
        `player` - The player who is riding the entity.
      Returns:
        If the player should orient the same direction as this entity.