public abstract class EntityLivingBase extends Entity
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
|
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_70741_aB |
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.
|
protected float |
movedDistance |
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.
|
protected float |
onGroundSpeedFactor |
float |
prevCameraPitch |
float |
prevLimbSwingAmount |
protected float |
prevMovedDistance |
protected float |
prevOnGroundSpeedFactor |
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, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, extendedProperties, fallDistance, field_181016_an, field_181017_ao, field_181018_ap, fireResistance, firstUpdate, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, renderDistanceWeight, riddenByEntity, ridingEntity, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, ticksExisted, timeUntilPortal, velocityChanged, width, worldObj
Constructor and Description |
---|
EntityLivingBase(World worldIn) |
Modifier and Type | Method and Description |
---|---|
void |
addPotionEffect(PotionEffect potioneffectIn)
adds a PotionEffect to the entity
|
protected void |
addRandomDrop()
Causes this Entity to drop a random item.
|
protected float |
applyArmorCalculations(DamageSource source,
float damage)
Reduces damage, depending on armor
|
protected void |
applyEntityAttributes() |
protected float |
applyPotionDamageCalculations(DamageSource source,
float damage)
Reduces damage, depending on potions
|
boolean |
attackEntityAsMob(Entity entityIn) |
boolean |
attackEntityFrom(DamageSource source,
float amount)
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() |
protected boolean |
canDropLoot()
Entity won't drop items or experience points if this returns false
|
boolean |
canEntityBeSeen(Entity entityIn)
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 damageSrc,
float damageAmount)
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 |
entityInit() |
void |
fall(float distance,
float damageMultiplier) |
protected float |
func_110146_f(float p_110146_1_,
float p_110146_2_) |
void |
func_181013_g(float p_181013_1_) |
EntityLivingBase |
func_94060_bK() |
float |
getAbsorptionAmount() |
PotionEffect |
getActivePotionEffect(Potion potionIn)
returns the PotionEffect for the supplied Potion if it is active, null otherwise.
|
java.util.Collection<PotionEffect> |
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() |
CombatTracker |
getCombatTracker() |
EnumCreatureAttribute |
getCreatureAttribute()
Get this Entity's EnumCreatureAttribute
|
abstract ItemStack |
getCurrentArmor(int slotIn) |
protected java.lang.String |
getDeathSound()
Returns the sound this mob makes on death.
|
IAttributeInstance |
getEntityAttribute(IAttribute attribute) |
abstract ItemStack |
getEquipmentInSlot(int slotIn)
0: Tool in Hand; 1-4: Armor
|
protected int |
getExperiencePoints(EntityPlayer player)
Get the experience points the entity currently has.
|
protected java.lang.String |
getFallSoundString(int damageValue) |
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.
|
abstract ItemStack[] |
getInventory()
returns the inventory of this entity (only used in EntityPlayerMP it seems)
|
protected float |
getJumpUpwardsMotion() |
EntityLivingBase |
getLastAttacker() |
int |
getLastAttackerTime() |
Vec3 |
getLook(float partialTicks)
interpolated look vector
|
Vec3 |
getLookVec()
returns a (normalized) vector of where this entity is looking
|
float |
getMaxHealth() |
int |
getRevengeTimer() |
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 partialTickTime)
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
|
protected void |
handleJumpLava() |
void |
handleStatusUpdate(byte id) |
void |
heal(float healAmount)
Heal living entity (param: amount of half-hearts)
|
boolean |
isChild()
If Animal, checks if the age timer is negative
|
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 otherEntity) |
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 potionId) |
boolean |
isPotionActive(Potion potionIn) |
boolean |
isPotionApplicable(PotionEffect potioneffectIn) |
boolean |
isServerWorld()
Returns whether the entity is in a server world
|
protected void |
jump()
Causes this entity to do an upwards motion (jumping).
|
protected void |
kill()
sets the dead flag.
|
void |
knockBack(Entity entityIn,
float p_70653_2_,
double p_70653_3_,
double p_70653_5_)
knocks back this entity
|
protected void |
markPotionsDirty() |
void |
mountEntity(Entity entityIn)
Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.
|
void |
moveEntityWithHeading(float strafe,
float forward)
Moves the entity based on the specified heading.
|
protected void |
onChangedPotionEffect(PotionEffect id,
boolean p_70695_2_) |
void |
onDeath(DamageSource cause)
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 |
onKillCommand()
Called by the /kill command.
|
void |
onLivingUpdate()
Called frequently so the entity can update its state every tick as required.
|
protected void |
onNewPotionEffect(PotionEffect id) |
void |
onUpdate()
Called to update the entity's position/logic.
|
void |
performHurtAnimation()
Setups the entity to do the hurt animation.
|
void |
readEntityFromNBT(NBTTagCompound tagCompund)
(abstract) Protected helper method to read subclass entity data from NBT.
|
void |
removePotionEffect(int potionId)
Remove the specified potion effect from this entity.
|
void |
removePotionEffectClient(int potionId)
Remove the speified potion effect from this entity.
|
void |
renderBrokenItemStack(ItemStack stack)
Renders broken item particles using the given ItemStack
|
protected void |
resetPotionEffectMetadata()
Resets the potion effect color and ambience metadata values
|
void |
sendEndCombat()
Sends an END_COMBAT packet to the client
|
void |
sendEnterCombat()
Sends an ENTER_COMBAT packet to the client
|
void |
setAbsorptionAmount(float amount) |
void |
setAIMoveSpeed(float speedIn)
set the movespeed used for the new AI system
|
void |
setArrowCountInEntity(int count)
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 slotIn,
ItemStack stack)
Sets the held item, or an armor slot.
|
void |
setHealth(float health) |
void |
setJumping(boolean p_70637_1_) |
void |
setLastAttacker(Entity entityIn) |
void |
setPositionAndRotation2(double x,
double y,
double z,
float yaw,
float pitch,
int posRotationIncrements,
boolean p_180426_10_) |
void |
setRevengeTarget(EntityLivingBase livingBase) |
void |
setRotationYawHead(float rotation)
Sets the head's yaw rotation of the entity.
|
void |
setSprinting(boolean sprinting)
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 |
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 y,
boolean onGroundIn,
Block blockIn,
BlockPos pos) |
protected void |
updatePotionEffects() |
protected void |
updatePotionMetadata()
Clears potion metadata values if the entity has no potion effects.
|
void |
updateRidden()
Handles updating while being ridden by an entity
|
void |
writeEntityToNBT(NBTTagCompound tagCompound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addChatMessage, addEntityCrashInfo, addToPlayerScore, addVelocity, applyEnchantments, applyEntityCollision, canAttackWithItem, canCommandSenderUseCommand, canRenderOnFire, canRiderInteract, canTriggerWalking, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, func_174817_o, func_181012_aH, func_181014_aG, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCapability, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getCustomNameTag, getDataWatcher, getDisplayName, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getExplosionResistance, getExtendedProperties, getEyeHeight, getFlag, getHorizontalFacing, getHoverEvent, getMaxFallHeight, getMaxInPortalTime, getMountedYOffset, getName, getNBTTagCompound, getParts, getPersistentID, getPickedResult, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getSplashSound, getSwimSound, getUniqueID, getVectorForRotation, getYOffset, handleWaterMovement, hasCapability, hasCustomName, hashCode, hitByEntity, interactAt, interactFirst, isBurning, isCreatureType, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isOffsetPositionInLiquid, isOutsideBorder, isPushedByWater, isRiding, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onKillEntity, onStruckByLightning, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, rayTrace, readFromNBT, registerExtendedProperties, replaceItemInInventory, resetEntityId, resetHeight, sendCommandFeedback, serializeNBT, setAir, setAlwaysRenderNameTag, setAngles, setCommandStat, setCustomNameTag, setDead, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setInWeb, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPortal, setPosition, setPositionAndRotation, setPositionAndUpdate, setRotation, setSilent, setSize, setSneaking, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, toString, travelToDimension, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptional
public boolean isSwingInProgress
public int swingProgressInt
public int arrowHitTimer
public int hurtTime
public int maxHurtTime
public float attackedAtYaw
public int deathTime
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 prevOnGroundSpeedFactor
protected float onGroundSpeedFactor
protected float movedDistance
protected float prevMovedDistance
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 worldIn)
public void onKillCommand()
onKillCommand
in class Entity
protected void entityInit()
entityInit
in class Entity
protected void applyEntityAttributes()
protected void updateFallState(double y, boolean onGroundIn, Block blockIn, BlockPos pos)
updateFallState
in class Entity
public boolean canBreatheUnderwater()
public void onEntityUpdate()
onEntityUpdate
in class Entity
public boolean isChild()
protected void onDeathUpdate()
protected boolean canDropLoot()
protected int decreaseAirSupply(int p_70682_1_)
protected int getExperiencePoints(EntityPlayer player)
protected boolean isPlayer()
public java.util.Random getRNG()
public EntityLivingBase getAITarget()
public int getRevengeTimer()
public void setRevengeTarget(EntityLivingBase livingBase)
public EntityLivingBase getLastAttacker()
public int getLastAttackerTime()
public void setLastAttacker(Entity entityIn)
public int getAge()
public void writeEntityToNBT(NBTTagCompound tagCompound)
writeEntityToNBT
in class Entity
public void readEntityFromNBT(NBTTagCompound tagCompund)
readEntityFromNBT
in class Entity
protected void updatePotionEffects()
protected void updatePotionMetadata()
protected void resetPotionEffectMetadata()
public void clearActivePotions()
public java.util.Collection<PotionEffect> getActivePotionEffects()
public boolean isPotionActive(int potionId)
public boolean isPotionActive(Potion potionIn)
public PotionEffect getActivePotionEffect(Potion potionIn)
public void addPotionEffect(PotionEffect potioneffectIn)
public boolean isPotionApplicable(PotionEffect potioneffectIn)
public boolean isEntityUndead()
public void removePotionEffectClient(int potionId)
public void removePotionEffect(int potionId)
protected void onNewPotionEffect(PotionEffect id)
protected void onChangedPotionEffect(PotionEffect id, boolean p_70695_2_)
protected void onFinishedPotionEffect(PotionEffect p_70688_1_)
public void heal(float healAmount)
public final float getHealth()
public void setHealth(float health)
public boolean attackEntityFrom(DamageSource source, float amount)
attackEntityFrom
in class Entity
public void renderBrokenItemStack(ItemStack stack)
public void onDeath(DamageSource cause)
protected void dropEquipment(boolean p_82160_1_, int p_82160_2_)
public void knockBack(Entity entityIn, float p_70653_2_, double p_70653_3_, double p_70653_5_)
protected java.lang.String getHurtSound()
protected java.lang.String getDeathSound()
protected void addRandomDrop()
protected void dropFewItems(boolean p_70628_1_, int p_70628_2_)
public boolean isOnLadder()
public boolean isEntityAlive()
isEntityAlive
in class Entity
protected java.lang.String getFallSoundString(int damageValue)
public void performHurtAnimation()
performHurtAnimation
in class Entity
public int getTotalArmorValue()
protected void damageArmor(float p_70675_1_)
protected float applyArmorCalculations(DamageSource source, float damage)
protected float applyPotionDamageCalculations(DamageSource source, float damage)
protected void damageEntity(DamageSource damageSrc, float damageAmount)
public CombatTracker getCombatTracker()
public EntityLivingBase func_94060_bK()
public final float getMaxHealth()
public final int getArrowCountInEntity()
public final void setArrowCountInEntity(int count)
public void swingItem()
public void handleStatusUpdate(byte id)
handleStatusUpdate
in class Entity
protected void kill()
protected void updateArmSwingProgress()
public IAttributeInstance getEntityAttribute(IAttribute attribute)
public BaseAttributeMap getAttributeMap()
public EnumCreatureAttribute getCreatureAttribute()
public abstract ItemStack getHeldItem()
public abstract ItemStack getEquipmentInSlot(int slotIn)
public abstract ItemStack getCurrentArmor(int slotIn)
public abstract void setCurrentItemOrArmor(int slotIn, ItemStack stack)
setCurrentItemOrArmor
in class Entity
public void setSprinting(boolean sprinting)
setSprinting
in class Entity
public abstract ItemStack[] getInventory()
getInventory
in class Entity
protected float getSoundVolume()
protected float getSoundPitch()
protected boolean isMovementBlocked()
public void dismountEntity(Entity p_110145_1_)
public boolean getAlwaysRenderNameTagForRender()
getAlwaysRenderNameTagForRender
in class Entity
protected float getJumpUpwardsMotion()
protected void jump()
protected void updateAITick()
protected void handleJumpLava()
public void moveEntityWithHeading(float strafe, float forward)
public float getAIMoveSpeed()
public void setAIMoveSpeed(float speedIn)
public boolean attackEntityAsMob(Entity entityIn)
public boolean isPlayerSleeping()
public void onUpdate()
protected float func_110146_f(float p_110146_1_, float p_110146_2_)
public void onLivingUpdate()
protected void updateEntityActionState()
protected void collideWithNearbyEntities()
protected void collideWithEntity(Entity p_82167_1_)
public void mountEntity(Entity entityIn)
mountEntity
in class Entity
public void updateRidden()
updateRidden
in class Entity
public void setPositionAndRotation2(double x, double y, double z, float yaw, float pitch, int posRotationIncrements, boolean p_180426_10_)
setPositionAndRotation2
in class Entity
public void setJumping(boolean p_70637_1_)
public void onItemPickup(Entity p_71001_1_, int p_71001_2_)
public boolean canEntityBeSeen(Entity entityIn)
public Vec3 getLookVec()
getLookVec
in class Entity
public Vec3 getLook(float partialTicks)
public float getSwingProgress(float partialTickTime)
public boolean isServerWorld()
public boolean canBeCollidedWith()
canBeCollidedWith
in class Entity
public boolean canBePushed()
canBePushed
in class Entity
protected void setBeenAttacked()
setBeenAttacked
in class Entity
public float getRotationYawHead()
getRotationYawHead
in class Entity
public void setRotationYawHead(float rotation)
setRotationYawHead
in class Entity
public void func_181013_g(float p_181013_1_)
func_181013_g
in class Entity
public float getAbsorptionAmount()
public void setAbsorptionAmount(float amount)
public Team getTeam()
public boolean isOnSameTeam(EntityLivingBase otherEntity)
public boolean isOnTeam(Team p_142012_1_)
public void sendEnterCombat()
public void sendEndCombat()
protected void markPotionsDirty()
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.