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.
|
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, 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 par1World) |
Modifier and Type | Method and Description |
---|---|
void |
addPotionEffect(PotionEffect par1PotionEffect)
adds a PotionEffect to the entity
|
protected float |
applyArmorCalculations(DamageSource par1DamageSource,
float par2)
Reduces damage, depending on armor
|
protected void |
applyEntityAttributes() |
protected float |
applyPotionDamageCalculations(DamageSource par1DamageSource,
float par2)
Reduces damage, depending on potions
|
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() |
protected void |
collideWithEntity(Entity par1Entity) |
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 par1) |
protected void |
damageEntity(DamageSource par1DamageSource,
float par2)
Deals damage to the entity.
|
protected int |
decreaseAirSupply(int par1)
Decrements the entity's air supply when underwater
|
void |
dismountEntity(Entity par1Entity)
Moves the entity to a position out of the way of its mount.
|
protected void |
dropEquipment(boolean par1,
int par2)
Drop the equipment for this entity.
|
protected void |
dropFewItems(boolean par1,
int par2)
Drop 0-2 items of this living's type.
|
protected void |
dropRareDrop(int par1) |
protected void |
entityInit() |
protected void |
fall(float par1)
Called when the mob is falling.
|
CombatTracker |
func_110142_aN() |
protected float |
func_110146_f(float par1,
float par2) |
int |
func_142015_aE() |
protected boolean |
func_146066_aG() |
protected java.lang.String |
func_146067_o(int p_146067_1_) |
EntityLivingBase |
func_94060_bK() |
float |
getAbsorptionAmount() |
PotionEffect |
getActivePotionEffect(Potion par1Potion)
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.
|
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 par1Attribute) |
abstract ItemStack |
getEquipmentInSlot(int var1)
0: Tool in Hand; 1-4: Armor
|
protected int |
getExperiencePoints(EntityPlayer par1EntityPlayer)
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 par1ItemStack,
int par2)
Gets the Icon Index of the item currently held
|
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)
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 par1)
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 par1) |
void |
heal(float par1)
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 par1EntityLivingBase) |
boolean |
isOnTeam(Team par1Team)
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 par1) |
boolean |
isPotionActive(Potion par1Potion) |
boolean |
isPotionApplicable(PotionEffect par1PotionEffect) |
protected void |
jump()
Causes this entity to do an upwards motion (jumping).
|
protected void |
kill()
sets the dead flag.
|
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.
|
protected void |
onChangedPotionEffect(PotionEffect par1PotionEffect,
boolean par2) |
void |
onDeath(DamageSource par1DamageSource)
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 par1PotionEffect) |
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.
|
protected void |
onNewPotionEffect(PotionEffect par1PotionEffect) |
void |
onUpdate()
Called to update the entity's position/logic.
|
void |
performHurtAnimation()
Setups the entity to do the hurt animation.
|
MovingObjectPosition |
rayTrace(double par1,
float par3)
Performs a ray trace for the distance specified and using the partial tick time.
|
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.
|
protected void |
setBeenAttacked()
Sets that this entity has been attacked.
|
abstract void |
setCurrentItemOrArmor(int var1,
ItemStack var2)
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)
Sets the position and rotation.
|
void |
setPositionAndUpdate(double par1,
double par3,
double par5)
Sets the position of the entity, keeps yaw/pitch, and updates the 'last' variables
|
void |
setRevengeTarget(EntityLivingBase par1EntityLivingBase) |
void |
setRotationYawHead(float par1)
Sets the head's yaw rotation of the entity.
|
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.
|
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 par1,
boolean par3)
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 par1NBTTagCompound)
(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, writeToNBTOptional
public 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 par1World)
protected void entityInit()
entityInit
in class Entity
protected void applyEntityAttributes()
protected void updateFallState(double par1, boolean par3)
updateFallState
in class Entity
public boolean canBreatheUnderwater()
public void onEntityUpdate()
onEntityUpdate
in class Entity
public boolean isChild()
protected void onDeathUpdate()
protected boolean func_146066_aG()
protected int decreaseAirSupply(int par1)
protected int getExperiencePoints(EntityPlayer par1EntityPlayer)
protected boolean isPlayer()
public java.util.Random getRNG()
public EntityLivingBase getAITarget()
public int func_142015_aE()
public void setRevengeTarget(EntityLivingBase par1EntityLivingBase)
public EntityLivingBase getLastAttacker()
public int getLastAttackerTime()
public void setLastAttacker(Entity par1Entity)
public int getAge()
public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound)
writeEntityToNBT
in class Entity
public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound)
readEntityFromNBT
in class Entity
protected void updatePotionEffects()
public void clearActivePotions()
public java.util.Collection getActivePotionEffects()
public boolean isPotionActive(int par1)
public boolean isPotionActive(Potion par1Potion)
public PotionEffect getActivePotionEffect(Potion par1Potion)
public void addPotionEffect(PotionEffect par1PotionEffect)
public boolean isPotionApplicable(PotionEffect par1PotionEffect)
public boolean isEntityUndead()
public void removePotionEffectClient(int par1)
public void removePotionEffect(int par1)
protected void onNewPotionEffect(PotionEffect par1PotionEffect)
protected void onChangedPotionEffect(PotionEffect par1PotionEffect, boolean par2)
protected void onFinishedPotionEffect(PotionEffect par1PotionEffect)
public void heal(float par1)
public final float getHealth()
public void setHealth(float par1)
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
attackEntityFrom
in class Entity
public void renderBrokenItemStack(ItemStack par1ItemStack)
public void onDeath(DamageSource par1DamageSource)
protected void dropEquipment(boolean par1, int par2)
public void knockBack(Entity par1Entity, float par2, double par3, double par5)
protected java.lang.String getHurtSound()
protected java.lang.String getDeathSound()
protected void dropRareDrop(int par1)
protected void dropFewItems(boolean par1, int par2)
public boolean isOnLadder()
public boolean isEntityAlive()
isEntityAlive
in class Entity
protected void fall(float par1)
protected java.lang.String func_146067_o(int p_146067_1_)
public void performHurtAnimation()
performHurtAnimation
in class Entity
public int getTotalArmorValue()
protected void damageArmor(float par1)
protected float applyArmorCalculations(DamageSource par1DamageSource, float par2)
protected float applyPotionDamageCalculations(DamageSource par1DamageSource, float par2)
protected void damageEntity(DamageSource par1DamageSource, float par2)
public CombatTracker func_110142_aN()
public EntityLivingBase func_94060_bK()
public final float getMaxHealth()
public final int getArrowCountInEntity()
public final void setArrowCountInEntity(int par1)
public void swingItem()
public void handleHealthUpdate(byte par1)
handleHealthUpdate
in class Entity
protected void kill()
protected void updateArmSwingProgress()
public IAttributeInstance getEntityAttribute(IAttribute par1Attribute)
public BaseAttributeMap getAttributeMap()
public EnumCreatureAttribute getCreatureAttribute()
public abstract ItemStack getHeldItem()
public abstract ItemStack getEquipmentInSlot(int var1)
public abstract void setCurrentItemOrArmor(int var1, ItemStack var2)
setCurrentItemOrArmor
in class Entity
public void setSprinting(boolean par1)
setSprinting
in class Entity
public abstract ItemStack[] getLastActiveItems()
getLastActiveItems
in class Entity
protected float getSoundVolume()
protected float getSoundPitch()
protected boolean isMovementBlocked()
public void setPositionAndUpdate(double par1, double par3, double par5)
public void dismountEntity(Entity par1Entity)
public boolean getAlwaysRenderNameTagForRender()
public IIcon getItemIcon(ItemStack par1ItemStack, int par2)
protected void jump()
public void moveEntityWithHeading(float par1, float par2)
protected boolean isAIEnabled()
public float getAIMoveSpeed()
public void setAIMoveSpeed(float par1)
public boolean attackEntityAsMob(Entity par1Entity)
public boolean isPlayerSleeping()
public void onUpdate()
protected float func_110146_f(float par1, float par2)
public void onLivingUpdate()
protected void updateAITasks()
protected void collideWithNearbyEntities()
protected void collideWithEntity(Entity par1Entity)
public void updateRidden()
updateRidden
in class Entity
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
setPositionAndRotation2
in class Entity
protected void updateAITick()
protected void updateEntityActionState()
public void setJumping(boolean par1)
public void onItemPickup(Entity par1Entity, int par2)
public boolean canEntityBeSeen(Entity par1Entity)
public Vec3 getLookVec()
getLookVec
in class Entity
public Vec3 getLook(float par1)
public float getSwingProgress(float par1)
public Vec3 getPosition(float par1)
public MovingObjectPosition rayTrace(double par1, float par3)
public boolean isClientWorld()
public boolean canBeCollidedWith()
canBeCollidedWith
in class Entity
public boolean canBePushed()
canBePushed
in class Entity
public float getEyeHeight()
getEyeHeight
in class Entity
protected void setBeenAttacked()
setBeenAttacked
in class Entity
public float getRotationYawHead()
getRotationYawHead
in class Entity
public void setRotationYawHead(float par1)
setRotationYawHead
in class Entity
public float getAbsorptionAmount()
public void setAbsorptionAmount(float par1)
public Team getTeam()
public boolean isOnSameTeam(EntityLivingBase par1EntityLivingBase)
public boolean isOnTeam(Team par1Team)
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.