Class EntityLivingBase

    • Field Detail

      • isSwingInProgress

        public boolean isSwingInProgress
      • swingProgressInt

        public int swingProgressInt
      • arrowHitTimer

        public int arrowHitTimer
      • hurtTime

        public int hurtTime
      • maxHurtTime

        public int maxHurtTime
      • attackedAtYaw

        public float attackedAtYaw
      • deathTime

        public int deathTime
      • prevSwingProgress

        public float prevSwingProgress
      • swingProgress

        public float swingProgress
      • prevLimbSwingAmount

        public float prevLimbSwingAmount
      • limbSwingAmount

        public float limbSwingAmount
      • limbSwing

        public float limbSwing
      • 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
      • prevRotationYawHead

        public float prevRotationYawHead
      • jumpMovementFactor

        public float jumpMovementFactor
        + A factor used to determine how far this entity will move each tick if it is jumping or falling.
      • recentlyHit

        protected int recentlyHit
      • dead

        protected boolean dead
      • entityAge

        protected int entityAge
      • prevOnGroundSpeedFactor

        protected float prevOnGroundSpeedFactor
      • onGroundSpeedFactor

        protected float onGroundSpeedFactor
      • movedDistance

        protected float movedDistance
      • prevMovedDistance

        protected float prevMovedDistance
      • field_70741_aB

        protected float field_70741_aB
      • scoreValue

        protected int scoreValue
      • lastDamage

        protected float lastDamage
      • isJumping

        protected boolean isJumping
      • moveStrafing

        public float moveStrafing
      • moveForward

        public float moveForward
      • randomYawVelocity

        protected float randomYawVelocity
      • newPosRotationIncrements

        protected int newPosRotationIncrements
      • newPosX

        protected double newPosX
      • newPosY

        protected double newPosY
      • newPosZ

        protected double newPosZ
      • newRotationYaw

        protected double newRotationYaw
      • newRotationPitch

        protected double newRotationPitch
    • Constructor Detail

      • EntityLivingBase

        public EntityLivingBase​(World worldIn)
    • Method Detail

      • onKillCommand

        public void onKillCommand()
        + Called by the /kill command.
        Overrides:
        onKillCommand in class Entity
      • entityInit

        protected void entityInit()
        Specified by:
        entityInit in class Entity
      • applyEntityAttributes

        protected void applyEntityAttributes()
      • 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
      • onDeathUpdate

        protected void onDeathUpdate()
        + handles entity death timer, experience orb and particle creation
      • canDropLoot

        protected boolean canDropLoot()
        + Entity won't drop items or experience points if this returns false
      • decreaseAirSupply

        protected int decreaseAirSupply​(int parInt1)
        + Decrements the entity's air supply when underwater
      • getExperiencePoints

        protected int getExperiencePoints​(EntityPlayer player)
        + Get the experience points the entity currently has.
      • isPlayer

        protected boolean isPlayer()
        + Only use is to identify if class is an instance of player for experience dropping
      • getRevengeTimer

        public int getRevengeTimer()
      • setRevengeTarget

        public void setRevengeTarget​(EntityLivingBase livingBase)
      • getLastAttackerTime

        public int getLastAttackerTime()
      • setLastAttacker

        public void setLastAttacker​(Entity entityIn)
      • getAge

        public int getAge()
      • writeEntityToNBT

        public void writeEntityToNBT​(NBTTagCompound nbttagcompound)
        + (abstract) Protected helper method to write subclass entity data to NBT.
        Specified by:
        writeEntityToNBT in class Entity
      • readEntityFromNBT

        public void readEntityFromNBT​(NBTTagCompound nbttagcompound)
        + (abstract) Protected helper method to read subclass entity data from NBT.
        Specified by:
        readEntityFromNBT in class Entity
      • updatePotionEffects

        protected void updatePotionEffects()
      • updatePotionMetadata

        protected void updatePotionMetadata()
        + Clears potion metadata values if the entity has no potion effects. Otherwise, updates potion effect color, ambience, and invisibility metadata values
      • resetPotionEffectMetadata

        protected void resetPotionEffectMetadata()
        + Resets the potion effect color and ambience metadata values
      • clearActivePotions

        public void clearActivePotions()
      • getActivePotionEffects

        public java.util.Collection<PotionEffect> getActivePotionEffects()
      • isPotionActive

        public boolean isPotionActive​(int potionId)
      • isPotionActive

        public boolean isPotionActive​(Potion potionIn)
      • getActivePotionEffect

        public PotionEffect getActivePotionEffect​(Potion potionIn)
        + returns the PotionEffect for the supplied Potion if it is active, null otherwise.
      • addPotionEffect

        public void addPotionEffect​(PotionEffect potioneffectIn)
        + adds a PotionEffect to the entity
      • isPotionApplicable

        public boolean isPotionApplicable​(PotionEffect potioneffectIn)
      • isEntityUndead

        public boolean isEntityUndead()
        + Returns true if this entity is undead.
      • removePotionEffectClient

        public void removePotionEffectClient​(int potionId)
        + Remove the speified potion effect from this entity.
      • removePotionEffect

        public void removePotionEffect​(int potionId)
        + Remove the specified potion effect from this entity.
      • onNewPotionEffect

        protected void onNewPotionEffect​(PotionEffect potioneffect)
      • onChangedPotionEffect

        protected void onChangedPotionEffect​(PotionEffect potioneffect,
                                             boolean flag)
      • onFinishedPotionEffect

        protected void onFinishedPotionEffect​(PotionEffect potioneffect)
      • heal

        public void heal​(float f)
        + Heal living entity (param: amount of half-hearts)
      • getHealth

        public final float getHealth()
      • setHealth

        public void setHealth​(float health)
      • attackEntityFrom

        public boolean attackEntityFrom​(DamageSource damagesource,
                                        float f)
        + Called when the entity is attacked.
        Overrides:
        attackEntityFrom in class Entity
      • renderBrokenItemStack

        public void renderBrokenItemStack​(ItemStack stack)
        + Renders broken item particles using the given ItemStack
      • onDeath

        public void onDeath​(DamageSource damagesource)
        + Called when the mob's health reaches 0.
      • dropEquipment

        protected void dropEquipment​(boolean parFlag,
                                     int parInt1)
        + Drop the equipment for this entity.
      • knockBack

        public void knockBack​(Entity entityIn,
                              float parFloat1,
                              double parDouble1,
                              double parDouble2)
        + knocks back this entity
      • getHurtSound

        protected java.lang.String getHurtSound()
        + Returns the sound this mob makes when it is hurt.
      • getDeathSound

        protected java.lang.String getDeathSound()
        + Returns the sound this mob makes on death.
      • addRandomDrop

        protected void addRandomDrop()
        + Causes this Entity to drop a random item.
      • dropFewItems

        protected void dropFewItems​(boolean parFlag,
                                    int parInt1)
        + Drop 0-2 items of this living's type
      • 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
      • fall

        public void fall​(float f,
                         float f1)
        Overrides:
        fall in class Entity
      • getFallSoundString

        protected java.lang.String getFallSoundString​(int damageValue)
      • performHurtAnimation

        public void performHurtAnimation()
        + Setups the entity to do the hurt animation. Only used by packets in multiplayer.
        Overrides:
        performHurtAnimation in class Entity
      • getTotalArmorValue

        public int getTotalArmorValue()
        + Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue
      • damageArmor

        protected void damageArmor​(float parFloat1)
      • applyArmorCalculations

        protected float applyArmorCalculations​(DamageSource source,
                                               float damage)
        + Reduces damage, depending on armor
      • applyPotionDamageCalculations

        protected float applyPotionDamageCalculations​(DamageSource source,
                                                      float damage)
        + Reduces damage, depending on potions
      • damageEntity

        protected void damageEntity​(DamageSource damagesource,
                                    float f)
        + Deals damage to the entity. If its a EntityPlayer then will take damage from the armor first and then health second with the reduced value. Args: damageAmount
      • 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 count)
        + sets the amount of arrows stuck in the entity. used for rendering those
      • swingItem

        public void swingItem()
        + Swings the item the player is holding.
      • kill

        protected void kill()
        + sets the dead flag. Used when you fall off the bottom of the world.
        Overrides:
        kill in class Entity
      • updateArmSwingProgress

        protected void updateArmSwingProgress()
        + Updates the arm swing progress counters and animation progress
      • getCreatureAttribute

        public EnumCreatureAttribute getCreatureAttribute()
        + Get this Entity's EnumCreatureAttribute
      • getHeldItem

        public abstract ItemStack getHeldItem()
      • getEquipmentInSlot

        public abstract ItemStack getEquipmentInSlot​(int var1)
      • getCurrentArmor

        public abstract ItemStack getCurrentArmor​(int var1)
      • setCurrentItemOrArmor

        public abstract void setCurrentItemOrArmor​(int var1,
                                                   ItemStack var2)
        Description copied from class: Entity
        + 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 flag)
        + Set sprinting switch for Entity.
        Overrides:
        setSprinting in class Entity
      • getInventory

        public abstract ItemStack[] getInventory()
        Description copied from class: Entity
        + returns the inventory of this entity (only used in EntityPlayerMP it seems)
        Overrides:
        getInventory in class Entity
      • getSoundVolume

        protected float getSoundVolume()
        + Returns the volume for the sounds this mob makes.
      • getSoundPitch

        protected float getSoundPitch()
        + Gets the pitch of living sounds in living entities.
      • isMovementBlocked

        protected boolean isMovementBlocked()
        + Dead and sleeping entities cannot move
      • dismountEntity

        public void dismountEntity​(Entity parEntity)
        + Moves the entity to a position out of the way of its mount.
      • getJumpUpwardsMotion

        protected float getJumpUpwardsMotion()
      • jump

        protected void jump()
        + Causes this entity to do an upwards motion (jumping).
      • updateAITick

        protected void updateAITick()
        + main AI tick function, replaces updateEntityActionState
      • handleJumpLava

        protected void handleJumpLava()
      • moveEntityWithHeading

        public void moveEntityWithHeading​(float f,
                                          float f1)
        + 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 speedIn)
        + set the movespeed used for the new AI system
      • attackEntityAsMob

        public boolean attackEntityAsMob​(Entity entityIn)
      • 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
      • func_110146_f

        protected float func_110146_f​(float parFloat1,
                                      float parFloat2)
      • 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.
      • updateEntityActionState

        protected void updateEntityActionState()
      • collideWithNearbyEntities

        protected void collideWithNearbyEntities()
      • collideWithEntity

        protected void collideWithEntity​(Entity parEntity)
      • mountEntity

        public void mountEntity​(Entity entity)
        + Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
        Overrides:
        mountEntity in class Entity
      • updateRidden

        public void updateRidden()
        + Handles updating while being ridden by an entity
        Overrides:
        updateRidden in class Entity
      • setPositionAndRotation2

        public void setPositionAndRotation2​(double d0,
                                            double d1,
                                            double d2,
                                            float f,
                                            float f1,
                                            int i,
                                            boolean var10)
        Overrides:
        setPositionAndRotation2 in class Entity
      • setJumping

        public void setJumping​(boolean parFlag)
      • onItemPickup

        public void onItemPickup​(Entity entity,
                                 int var2)
        + Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize
      • canEntityBeSeen

        public boolean canEntityBeSeen​(Entity entityIn)
        + 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 f)
        + interpolated look vector
        Overrides:
        getLook in class Entity
      • getSwingProgress

        public float getSwingProgress​(float partialTickTime)
        + Returns where in the swing animation the living entity is (from 0 to 1). Args: partialTickTime
      • isServerWorld

        public boolean isServerWorld()
        + Returns whether the entity is in a server 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
      • setBeenAttacked

        protected void setBeenAttacked()
        + Sets that this entity has been attacked.
        Overrides:
        setBeenAttacked in class Entity
      • setRotationYawHead

        public void setRotationYawHead​(float f)
        + Sets the head's yaw rotation of the entity.
        Overrides:
        setRotationYawHead in class Entity
      • func_181013_g

        public void func_181013_g​(float f)
        Overrides:
        func_181013_g in class Entity
      • getAbsorptionAmount

        public float getAbsorptionAmount()
      • setAbsorptionAmount

        public void setAbsorptionAmount​(float amount)
      • getTeam

        public Team getTeam()
      • isOnTeam

        public boolean isOnTeam​(Team parTeam)
        + Returns true if the entity is on a specific team.
      • sendEnterCombat

        public void sendEnterCombat()
        + Sends an ENTER_COMBAT packet to the client
      • sendEndCombat

        public void sendEndCombat()
        + Sends an END_COMBAT packet to the client
      • markPotionsDirty

        protected void markPotionsDirty()