public abstract class EntityLivingBase extends Entity
Entity.EnumEntitySize| Modifier and Type | Field and Description |
|---|---|
int |
arrowHitTimer |
float |
attackedAtYaw
The yaw at which this entity was last attacked from.
|
protected EntityPlayer |
attackingPlayer
The most recent player that has attacked this entity
|
int |
attackTime |
float |
cameraPitch |
protected boolean |
dead
This gets set on entity death, but never used.
|
int |
deathTime
The amount of time remaining this entity should act 'dead', i.e. have a corpse in the world.
|
protected int |
entityAge
The age of this EntityLiving (used to determine when it dies)
|
protected float |
field_110154_aX |
protected float |
field_70741_aB |
protected float |
field_70763_ax |
protected float |
field_70764_aw |
protected float |
field_70768_au |
float |
field_70769_ao |
float |
field_70770_ap |
int |
hurtTime
The amount of time remaining this entity should act 'hurt'.
|
protected boolean |
isJumping
used to check whether entity is jumping.
|
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.
|
protected float |
lastDamage
Damage taken in the last hit.
|
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 |
protected int |
newPosRotationIncrements
The number of updates over which the new position and rotation are to be applied to the entity.
|
protected double |
newPosX
The new X position to be applied to the entity.
|
protected double |
newPosY
The new Y position to be applied to the entity.
|
protected double |
newPosZ |
protected double |
newRotationPitch
The new yaw rotation to be applied to the entity.
|
protected double |
newRotationYaw
The new yaw rotation to be applied to the entity.
|
float |
prevCameraPitch |
float |
prevHealth |
float |
prevLimbSwingAmount |
float |
prevRenderYawOffset |
float |
prevRotationYawHead
Entity head rotation yaw at previous tick
|
float |
prevSwingProgress |
protected float |
randomYawVelocity |
protected int |
recentlyHit
Set to 60 when hit by the player or the player's wolf, then decrements.
|
float |
renderYawOffset |
float |
rotationYawHead
Entity head rotation yaw
|
protected int |
scoreValue
The score value of the Mob, the amount of points the mob is worth.
|
float |
swingProgress |
int |
swingProgressInt |
addedToChunk, boundingBox, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, extendedProperties, fallDistance, field_70135_K, fireResistance, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj, yOffset, ySize| Constructor and Description |
|---|
EntityLivingBase(World p_i1594_1_) |
| Modifier and Type | Method and Description |
|---|---|
void |
addPotionEffect(PotionEffect p_70690_1_)
adds a PotionEffect to the entity
|
protected float |
applyArmorCalculations(DamageSource p_70655_1_,
float p_70655_2_)
Reduces damage, depending on armor
|
protected void |
applyEntityAttributes() |
protected float |
applyPotionDamageCalculations(DamageSource p_70672_1_,
float p_70672_2_)
Reduces damage, depending on potions
|
boolean |
attackEntityAsMob(Entity p_70652_1_) |
boolean |
attackEntityFrom(DamageSource p_70097_1_,
float p_70097_2_)
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 p_70685_1_)
returns true if the entity provided in the argument can be seen.
|
void |
clearActivePotions() |
protected void |
collideWithEntity(Entity p_82167_1_) |
protected void |
collideWithNearbyEntities() |
void |
curePotionEffects(ItemStack curativeItem)
Removes all potion effects that have curativeItem as a curative item for its effect
|
protected void |
damageArmor(float p_70675_1_) |
protected void |
damageEntity(DamageSource p_70665_1_,
float p_70665_2_)
Deals damage to the entity.
|
protected int |
decreaseAirSupply(int p_70682_1_)
Decrements the entity's air supply when underwater
|
void |
dismountEntity(Entity p_110145_1_)
Moves the entity to a position out of the way of its mount.
|
protected void |
dropEquipment(boolean p_82160_1_,
int p_82160_2_)
Drop the equipment for this entity.
|
protected void |
dropFewItems(boolean p_70628_1_,
int p_70628_2_)
Drop 0-2 items of this living's type.
|
protected void |
dropRareDrop(int p_70600_1_) |
protected void |
entityInit() |
protected void |
fall(float p_70069_1_)
Called when the mob is falling.
|
CombatTracker |
func_110142_aN() |
protected float |
func_110146_f(float p_110146_1_,
float p_110146_2_) |
int |
func_142015_aE() |
protected boolean |
func_146066_aG() |
protected java.lang.String |
func_146067_o(int p_146067_1_) |
void |
func_152111_bt() |
void |
func_152112_bu() |
EntityLivingBase |
func_94060_bK() |
float |
getAbsorptionAmount() |
PotionEffect |
getActivePotionEffect(Potion p_70660_1_)
returns the PotionEffect for the supplied Potion if it is active, null otherwise.
|
java.util.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. getting hit by arrows increases this, used in rendering
|
BaseAttributeMap |
getAttributeMap() |
EnumCreatureAttribute |
getCreatureAttribute()
Get this Entity's EnumCreatureAttribute
|
protected java.lang.String |
getDeathSound()
Returns the sound this mob makes on death.
|
IAttributeInstance |
getEntityAttribute(IAttribute p_110148_1_) |
abstract ItemStack |
getEquipmentInSlot(int p_71124_1_)
0: Tool in Hand; 1-4: Armor
|
protected int |
getExperiencePoints(EntityPlayer p_70693_1_)
Get the experience points the entity currently has.
|
float |
getEyeHeight() |
float |
getHealth() |
abstract ItemStack |
getHeldItem()
Returns the item that this EntityLiving is holding, if any.
|
protected java.lang.String |
getHurtSound()
Returns the sound this mob makes when it is hurt.
|
IIcon |
getItemIcon(ItemStack p_70620_1_,
int p_70620_2_)
Gets the Icon Index of the item currently held
|
abstract ItemStack[] |
getLastActiveItems() |
EntityLivingBase |
getLastAttacker() |
int |
getLastAttackerTime() |
Vec3 |
getLook(float p_70676_1_)
interpolated look vector
|
Vec3 |
getLookVec()
returns a (normalized) vector of where this entity is looking
|
float |
getMaxHealth() |
Vec3 |
getPosition(float p_70666_1_)
interpolated position vector
|
java.util.Random |
getRNG() |
float |
getRotationYawHead() |
protected float |
getSoundPitch()
Gets the pitch of living sounds in living entities.
|
protected float |
getSoundVolume()
Returns the volume for the sounds this mob makes.
|
float |
getSwingProgress(float p_70678_1_)
Returns where in the swing animation the living entity is (from 0 to 1).
|
Team |
getTeam() |
int |
getTotalArmorValue()
Returns the current armor value as determined by a call to InventoryPlayer.getTotalArmorValue
|
void |
handleHealthUpdate(byte p_70103_1_) |
void |
heal(float p_70691_1_)
Heal living entity (param: amount of half-hearts)
|
protected boolean |
isAIEnabled()
Returns true if the newer Entity AI code should be run
|
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.
|
protected boolean |
isMovementBlocked()
Dead and sleeping entities cannot move
|
boolean |
isOnLadder()
returns true if this entity is by a ladder, false otherwise
|
boolean |
isOnSameTeam(EntityLivingBase p_142014_1_) |
boolean |
isOnTeam(Team p_142012_1_)
Returns true if the entity is on a specific team.
|
protected boolean |
isPlayer()
Only use is to identify if class is an instance of player for experience dropping
|
boolean |
isPlayerSleeping()
Returns whether player is sleeping or not
|
boolean |
isPotionActive(int p_82165_1_) |
boolean |
isPotionActive(Potion p_70644_1_) |
boolean |
isPotionApplicable(PotionEffect p_70687_1_) |
protected void |
jump()
Causes this entity to do an upwards motion (jumping).
|
protected void |
kill()
sets the dead flag.
|
void |
knockBack(Entity p_70653_1_,
float p_70653_2_,
double p_70653_3_,
double p_70653_5_)
knocks back this entity
|
void |
moveEntityWithHeading(float p_70612_1_,
float p_70612_2_)
Moves the entity based on the specified heading.
|
protected void |
onChangedPotionEffect(PotionEffect p_70695_1_,
boolean p_70695_2_) |
void |
onDeath(DamageSource p_70645_1_)
Called when the mob's health reaches 0.
|
protected void |
onDeathUpdate()
handles entity death timer, experience orb and particle creation
|
void |
onEntityUpdate()
Gets called every tick from main Entity class
|
protected void |
onFinishedPotionEffect(PotionEffect p_70688_1_) |
void |
onItemPickup(Entity p_71001_1_,
int p_71001_2_)
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.
|
protected void |
onNewPotionEffect(PotionEffect p_70670_1_) |
void |
onUpdate()
Called to update the entity's position/logic.
|
void |
performHurtAnimation()
Setups the entity to do the hurt animation.
|
MovingObjectPosition |
rayTrace(double p_70614_1_,
float p_70614_3_)
Performs a ray trace for the distance specified and using the partial tick time.
|
void |
readEntityFromNBT(NBTTagCompound p_70037_1_)
(abstract) Protected helper method to read subclass entity data from NBT.
|
void |
removePotionEffect(int p_82170_1_)
Remove the specified potion effect from this entity.
|
void |
removePotionEffectClient(int p_70618_1_)
Remove the speified potion effect from this entity.
|
void |
renderBrokenItemStack(ItemStack p_70669_1_)
Renders broken item particles using the given ItemStack
|
void |
setAbsorptionAmount(float p_110149_1_) |
void |
setAIMoveSpeed(float p_70659_1_)
set the movespeed used for the new AI system
|
void |
setArrowCountInEntity(int p_85034_1_)
sets the amount of arrows stuck in the entity. used for rendering those
|
protected void |
setBeenAttacked()
Sets that this entity has been attacked.
|
abstract void |
setCurrentItemOrArmor(int p_70062_1_,
ItemStack p_70062_2_)
Sets the held item, or an armor slot.
|
void |
setHealth(float p_70606_1_) |
void |
setJumping(boolean p_70637_1_) |
void |
setLastAttacker(Entity p_130011_1_) |
void |
setPositionAndRotation2(double p_70056_1_,
double p_70056_3_,
double p_70056_5_,
float p_70056_7_,
float p_70056_8_,
int p_70056_9_)
Sets the position and rotation.
|
void |
setPositionAndUpdate(double p_70634_1_,
double p_70634_3_,
double p_70634_5_)
Sets the position of the entity, keeps yaw/pitch, and updates the 'last' variables
|
void |
setRevengeTarget(EntityLivingBase p_70604_1_) |
void |
setRotationYawHead(float p_70034_1_)
Sets the head's yaw rotation of the entity.
|
void |
setSprinting(boolean p_70031_1_)
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.
|
protected void |
updateAITasks() |
protected void |
updateAITick()
main AI tick function, replaces updateEntityActionState
|
protected void |
updateArmSwingProgress()
Updates the arm swing progress counters and animation progress
|
protected void |
updateEntityActionState() |
protected void |
updateFallState(double p_70064_1_,
boolean p_70064_3_)
Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance
and deal fall damage if landing on the ground.
|
protected void |
updatePotionEffects() |
void |
updateRidden()
Handles updating while being ridden by an entity
|
void |
writeEntityToNBT(NBTTagCompound p_70014_1_)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addEntityCrashInfo, addToPlayerScore, addVelocity, applyEntityCollision, canAttackWithItem, canRenderOnFire, canRiderInteract, canTriggerWalking, copyDataFrom, copyLocationAndAnglesFrom, dealFireDamage, doesEntityNotTriggerPressurePlate, dropItem, entityDropItem, equals, extinguish, func_145748_c_, func_145771_j, func_145772_a, func_145774_a, func_145775_I, func_145778_a, func_145780_a, func_145781_i, getAir, getBoundingBox, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBox, getCommandSenderName, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityData, getEntityId, getEntityString, getExtendedProperties, getFlag, getMaxInPortalTime, getMaxSafePointTries, getMountedYOffset, getParts, getPersistentID, getPickedResult, getPortalCooldown, getShadowSize, getSplashSound, getSwimSound, getTeleportDirection, getUniqueID, getYOffset, handleLavaMovement, handleWaterMovement, hashCode, hitByEntity, interactFirst, isBurning, isCreatureType, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToFire, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isOffsetPositionInLiquid, isPushedByWater, isRiding, isSneaking, isSprinting, isWet, mountEntity, moveEntity, moveFlying, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onKillEntity, onStruckByLightning, playSound, preparePlayerToSpawn, readFromNBT, registerExtendedProperties, resetEntityId, setAir, setAngles, setDead, setEating, setEntityId, setFire, setFlag, setInPortal, setInvisible, setInWeb, setLocationAndAngles, setOnFireFromLava, setPosition, setPositionAndRotation, setRotation, setSize, setSneaking, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, toString, travelToDimension, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptionalpublic boolean isSwingInProgress
public int swingProgressInt
public int arrowHitTimer
public float prevHealth
public int hurtTime
public int maxHurtTime
public float attackedAtYaw
public int deathTime
public int attackTime
public float prevSwingProgress
public float swingProgress
public float prevLimbSwingAmount
public float limbSwingAmount
public float limbSwing
public int maxHurtResistantTime
public float prevCameraPitch
public float cameraPitch
public float field_70769_ao
public float field_70770_ap
public float renderYawOffset
public float prevRenderYawOffset
public float rotationYawHead
public float prevRotationYawHead
public float jumpMovementFactor
protected EntityPlayer attackingPlayer
protected int recentlyHit
protected boolean dead
protected int entityAge
protected float field_70768_au
protected float field_110154_aX
protected float field_70764_aw
protected float field_70763_ax
protected float field_70741_aB
protected int scoreValue
protected float lastDamage
protected boolean isJumping
public float moveStrafing
public float moveForward
protected float randomYawVelocity
protected int newPosRotationIncrements
protected double newPosX
protected double newPosY
protected double newPosZ
protected double newRotationYaw
protected double newRotationPitch
public EntityLivingBase(World p_i1594_1_)
protected void entityInit()
entityInit in class Entityprotected void applyEntityAttributes()
protected void updateFallState(double p_70064_1_,
boolean p_70064_3_)
updateFallState in class Entitypublic boolean canBreatheUnderwater()
public void onEntityUpdate()
onEntityUpdate in class Entitypublic boolean isChild()
protected void onDeathUpdate()
protected boolean func_146066_aG()
protected int decreaseAirSupply(int p_70682_1_)
protected int getExperiencePoints(EntityPlayer p_70693_1_)
protected boolean isPlayer()
public java.util.Random getRNG()
public EntityLivingBase getAITarget()
public int func_142015_aE()
public void setRevengeTarget(EntityLivingBase p_70604_1_)
public EntityLivingBase getLastAttacker()
public int getLastAttackerTime()
public void setLastAttacker(Entity p_130011_1_)
public int getAge()
public void writeEntityToNBT(NBTTagCompound p_70014_1_)
writeEntityToNBT in class Entitypublic void readEntityFromNBT(NBTTagCompound p_70037_1_)
readEntityFromNBT in class Entityprotected void updatePotionEffects()
public void clearActivePotions()
public java.util.Collection getActivePotionEffects()
public boolean isPotionActive(int p_82165_1_)
public boolean isPotionActive(Potion p_70644_1_)
public PotionEffect getActivePotionEffect(Potion p_70660_1_)
public void addPotionEffect(PotionEffect p_70690_1_)
public boolean isPotionApplicable(PotionEffect p_70687_1_)
public boolean isEntityUndead()
public void removePotionEffectClient(int p_70618_1_)
public void removePotionEffect(int p_82170_1_)
protected void onNewPotionEffect(PotionEffect p_70670_1_)
protected void onChangedPotionEffect(PotionEffect p_70695_1_, boolean p_70695_2_)
protected void onFinishedPotionEffect(PotionEffect p_70688_1_)
public void heal(float p_70691_1_)
public final float getHealth()
public void setHealth(float p_70606_1_)
public boolean attackEntityFrom(DamageSource p_70097_1_, float p_70097_2_)
attackEntityFrom in class Entitypublic void renderBrokenItemStack(ItemStack p_70669_1_)
public void onDeath(DamageSource p_70645_1_)
protected void dropEquipment(boolean p_82160_1_,
int p_82160_2_)
public void knockBack(Entity p_70653_1_, float p_70653_2_, double p_70653_3_, double p_70653_5_)
protected java.lang.String getHurtSound()
protected java.lang.String getDeathSound()
protected void dropRareDrop(int p_70600_1_)
protected void dropFewItems(boolean p_70628_1_,
int p_70628_2_)
public boolean isOnLadder()
public boolean isEntityAlive()
isEntityAlive in class Entityprotected void fall(float p_70069_1_)
protected java.lang.String func_146067_o(int p_146067_1_)
public void performHurtAnimation()
performHurtAnimation in class Entitypublic int getTotalArmorValue()
protected void damageArmor(float p_70675_1_)
protected float applyArmorCalculations(DamageSource p_70655_1_, float p_70655_2_)
protected float applyPotionDamageCalculations(DamageSource p_70672_1_, float p_70672_2_)
protected void damageEntity(DamageSource p_70665_1_, float p_70665_2_)
public CombatTracker func_110142_aN()
public EntityLivingBase func_94060_bK()
public final float getMaxHealth()
public final int getArrowCountInEntity()
public final void setArrowCountInEntity(int p_85034_1_)
public void swingItem()
public void handleHealthUpdate(byte p_70103_1_)
handleHealthUpdate in class Entityprotected void kill()
protected void updateArmSwingProgress()
public IAttributeInstance getEntityAttribute(IAttribute p_110148_1_)
public BaseAttributeMap getAttributeMap()
public EnumCreatureAttribute getCreatureAttribute()
public abstract ItemStack getHeldItem()
public abstract ItemStack getEquipmentInSlot(int p_71124_1_)
public abstract void setCurrentItemOrArmor(int p_70062_1_,
ItemStack p_70062_2_)
setCurrentItemOrArmor in class Entitypublic void setSprinting(boolean p_70031_1_)
setSprinting in class Entitypublic abstract ItemStack[] getLastActiveItems()
getLastActiveItems in class Entityprotected float getSoundVolume()
protected float getSoundPitch()
protected boolean isMovementBlocked()
public void setPositionAndUpdate(double p_70634_1_,
double p_70634_3_,
double p_70634_5_)
public void dismountEntity(Entity p_110145_1_)
public boolean getAlwaysRenderNameTagForRender()
public IIcon getItemIcon(ItemStack p_70620_1_, int p_70620_2_)
protected void jump()
public void moveEntityWithHeading(float p_70612_1_,
float p_70612_2_)
protected boolean isAIEnabled()
public float getAIMoveSpeed()
public void setAIMoveSpeed(float p_70659_1_)
public boolean attackEntityAsMob(Entity p_70652_1_)
public boolean isPlayerSleeping()
public void onUpdate()
protected float func_110146_f(float p_110146_1_,
float p_110146_2_)
public void onLivingUpdate()
protected void updateAITasks()
protected void collideWithNearbyEntities()
protected void collideWithEntity(Entity p_82167_1_)
public void updateRidden()
updateRidden in class Entitypublic void setPositionAndRotation2(double p_70056_1_,
double p_70056_3_,
double p_70056_5_,
float p_70056_7_,
float p_70056_8_,
int p_70056_9_)
setPositionAndRotation2 in class Entityprotected void updateAITick()
protected void updateEntityActionState()
public void setJumping(boolean p_70637_1_)
public void onItemPickup(Entity p_71001_1_, int p_71001_2_)
public boolean canEntityBeSeen(Entity p_70685_1_)
public Vec3 getLookVec()
getLookVec in class Entitypublic Vec3 getLook(float p_70676_1_)
public float getSwingProgress(float p_70678_1_)
public Vec3 getPosition(float p_70666_1_)
public MovingObjectPosition rayTrace(double p_70614_1_, float p_70614_3_)
public boolean isClientWorld()
public boolean canBeCollidedWith()
canBeCollidedWith in class Entitypublic boolean canBePushed()
canBePushed in class Entitypublic float getEyeHeight()
getEyeHeight in class Entityprotected void setBeenAttacked()
setBeenAttacked in class Entitypublic float getRotationYawHead()
getRotationYawHead in class Entitypublic void setRotationYawHead(float p_70034_1_)
setRotationYawHead in class Entitypublic float getAbsorptionAmount()
public void setAbsorptionAmount(float p_110149_1_)
public Team getTeam()
public boolean isOnSameTeam(EntityLivingBase p_142014_1_)
public boolean isOnTeam(Team p_142012_1_)
public void curePotionEffects(ItemStack curativeItem)
curativeItem - The itemstack we are using to cure potion effectspublic boolean shouldRiderFaceForward(EntityPlayer player)
player - The player who is riding the entity.public void func_152111_bt()
public void func_152112_bu()