public abstract class EntityLiving extends EntityLivingBase
| Modifier and Type | Class and Description |
|---|---|
static class |
EntityLiving.SpawnPlacementType |
| Modifier and Type | Field and Description |
|---|---|
protected float[] |
equipmentDropChances
Chances for each equipment piece from dropping when this entity dies.
|
protected int |
experienceValue
The experience points the Entity gives.
|
protected EntityJumpHelper |
jumpHelper
Entity jumping helper
|
int |
livingSoundTime
Number of ticks since this EntityLiving last produced its sound
|
protected EntityMoveHelper |
moveHelper |
protected PathNavigate |
navigator |
EntityAITasks |
targetTasks
Fighting tasks (used by monsters, wolves, ocelots)
|
EntityAITasks |
tasks
Passive tasks (wandering, look, idle, ...)
|
arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, entityAge, field_70741_aB, field_70769_ao, field_70770_ap, hurtTime, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, newPosRotationIncrements, newPosX, newPosY, newPosZ, newRotationPitch, newRotationYaw, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, swingProgress, swingProgressIntaddedToChunk, 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 |
|---|
EntityLiving(World worldIn) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowLeashing() |
protected void |
applyEntityAttributes() |
boolean |
canAttackClass(java.lang.Class<? extends EntityLivingBase> cls)
Returns true if this entity can attack entities of the specified class.
|
boolean |
canBeSteered()
returns true if all the conditions for steering the entity are met.
|
protected boolean |
canDespawn()
Determines if an entity can be despawned, used on idle far away entities
|
boolean |
canPickUpLoot() |
void |
clearLeashed(boolean sendPacket,
boolean dropLead)
Removes the leash from this entity
|
protected void |
despawnEntity()
Makes the entity despawn if requirements are reached
|
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
|
void |
eatGrassBonus()
This function applies the benefits of growing back wool and faster growing up to the acting entity.
|
void |
enablePersistence()
Enable the Entity persistence
|
protected void |
entityInit() |
void |
faceEntity(Entity entityIn,
float p_70625_2_,
float p_70625_3_)
Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument.
|
protected float |
func_110146_f(float p_110146_1_,
float p_110146_2_) |
protected boolean |
func_175448_a(ItemStack stack) |
static Item |
getArmorItemForSlot(int armorSlot,
int itemTier)
Gets the vanilla armor Item that can go in the slot specified for the given tier.
|
static int |
getArmorPosition(ItemStack stack) |
EntityLivingBase |
getAttackTarget()
Gets the active target the Task system uses for tracking
|
boolean |
getCanSpawnHere()
Checks if the entity's current position is a valid location to spawn this entity.
|
ItemStack |
getCurrentArmor(int slotIn) |
protected Item |
getDropItem() |
EntitySenses |
getEntitySenses()
returns the EntitySenses Object for the EntityLiving
|
ItemStack |
getEquipmentInSlot(int slotIn)
0: Tool in Hand; 1-4: Armor
|
protected int |
getExperiencePoints(EntityPlayer player)
Get the experience points the entity currently has.
|
ItemStack |
getHeldItem()
Returns the item that this EntityLiving is holding, if any.
|
ItemStack[] |
getInventory()
returns the inventory of this entity (only used in EntityPlayerMP it seems)
|
EntityJumpHelper |
getJumpHelper() |
boolean |
getLeashed() |
Entity |
getLeashedToEntity() |
protected java.lang.String |
getLivingSound()
Returns the sound this mob makes while it's alive.
|
EntityLookHelper |
getLookHelper() |
int |
getMaxFallHeight()
The maximum height from where the entity is alowed to jump (used in pathfinder)
|
int |
getMaxSpawnedInChunk()
Will return how many at most can spawn in a chunk at once.
|
EntityMoveHelper |
getMoveHelper() |
PathNavigate |
getNavigator() |
protected PathNavigate |
getNewNavigator(World worldIn)
Returns new PathNavigateGround instance
|
float |
getRenderSizeModifier()
Returns render size modifier
|
int |
getTalkInterval()
Get number of ticks, at least during which the living entity will be silent.
|
int |
getVerticalFaceSpeed()
The speed it takes to move the entityliving's rotationPitch through the faceEntity method.
|
void |
handleStatusUpdate(byte id) |
protected boolean |
interact(EntityPlayer player)
Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.
|
boolean |
interactFirst(EntityPlayer playerIn)
First layer of player interaction
|
boolean |
isAIDisabled()
Get whether this Entity's AI is disabled
|
boolean |
isNoDespawnRequired() |
boolean |
isNotColliding()
Checks that the entity is not colliding with any blocks / liquids
|
boolean |
isServerWorld()
Returns whether the entity is in a server world
|
void |
onEntityUpdate()
Gets called every tick from main Entity class
|
IEntityLivingData |
onInitialSpawn(DifficultyInstance difficulty,
IEntityLivingData livingdata)
Called only once on an entity when first time spawned, via egg, mob spawner, natural spawning etc, but not called
when entity is reloaded from nbt.
|
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 |
playLivingSound()
Plays living's sound at its position
|
void |
readEntityFromNBT(NBTTagCompound tagCompund)
(abstract) Protected helper method to read subclass entity data from NBT.
|
boolean |
replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn) |
void |
setAIMoveSpeed(float speedIn)
set the movespeed used for the new AI system
|
void |
setAttackTarget(EntityLivingBase entitylivingbaseIn)
Sets the active target the Task system uses for tracking
|
void |
setCanPickUpLoot(boolean canPickup) |
void |
setCurrentItemOrArmor(int slotIn,
ItemStack stack)
Sets the held item, or an armor slot.
|
protected void |
setEnchantmentBasedOnDifficulty(DifficultyInstance difficulty)
Enchants Entity's current equipments based on given DifficultyInstance
|
protected void |
setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
Gives armor or weapon for entity based on given DifficultyInstance
|
void |
setEquipmentDropChance(int slotIn,
float chance) |
void |
setLeashedToEntity(Entity entityIn,
boolean sendAttachNotification)
Sets the entity to be leashed to.
|
void |
setMoveForward(float p_70657_1_) |
void |
setNoAI(boolean disable)
Set whether this Entity's AI is disabled
|
void |
spawnExplosionParticle()
Spawns an explosion particle around the Entity's location
|
protected void |
updateAITasks() |
protected void |
updateEntityActionState() |
protected void |
updateEquipmentIfNeeded(EntityItem itemEntity)
Tests if this entity should pickup a weapon or an armor.
|
protected void |
updateLeashedState()
Applies logic related to leashes, for example dragging the entity or breaking the leash.
|
void |
writeEntityToNBT(NBTTagCompound tagCompound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addPotionEffect, addRandomDrop, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, attackEntityFrom, canBeCollidedWith, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, curePotionEffects, damageArmor, damageEntity, decreaseAirSupply, dismountEntity, fall, func_181013_g, func_94060_bK, getAbsorptionAmount, getActivePotionEffect, getActivePotionEffects, getAge, getAIMoveSpeed, getAITarget, getAlwaysRenderNameTagForRender, getArrowCountInEntity, getAttributeMap, getCombatTracker, getCreatureAttribute, getDeathSound, getEntityAttribute, getFallSoundString, getHealth, getHurtSound, getJumpUpwardsMotion, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSoundVolume, getSwingProgress, getTeam, getTotalArmorValue, handleJumpLava, heal, isChild, isEntityAlive, isEntityUndead, isMovementBlocked, isOnLadder, isOnSameTeam, isOnTeam, isPlayer, isPlayerSleeping, isPotionActive, isPotionActive, isPotionApplicable, jump, kill, knockBack, markPotionsDirty, mountEntity, moveEntityWithHeading, onChangedPotionEffect, onDeath, onDeathUpdate, onFinishedPotionEffect, onItemPickup, onKillCommand, onNewPotionEffect, performHurtAnimation, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAbsorptionAmount, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setRevengeTarget, setRotationYawHead, setSprinting, shouldRiderFaceForward, swingItem, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffects, updatePotionMetadata, updateRiddenaddChatMessage, 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, getMaxInPortalTime, getMountedYOffset, getName, getNBTTagCompound, getParts, getPersistentID, getPickedResult, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getSplashSound, getSwimSound, getUniqueID, getVectorForRotation, getYOffset, handleWaterMovement, hasCapability, hasCustomName, hashCode, hitByEntity, interactAt, 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, 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, writeToNBTOptionalpublic int livingSoundTime
protected int experienceValue
protected EntityMoveHelper moveHelper
protected EntityJumpHelper jumpHelper
protected PathNavigate navigator
public final EntityAITasks tasks
public final EntityAITasks targetTasks
protected float[] equipmentDropChances
public EntityLiving(World worldIn)
protected void applyEntityAttributes()
applyEntityAttributes in class EntityLivingBaseprotected PathNavigate getNewNavigator(World worldIn)
public EntityLookHelper getLookHelper()
public EntityMoveHelper getMoveHelper()
public EntityJumpHelper getJumpHelper()
public PathNavigate getNavigator()
public EntitySenses getEntitySenses()
public EntityLivingBase getAttackTarget()
public void setAttackTarget(EntityLivingBase entitylivingbaseIn)
public boolean canAttackClass(java.lang.Class<? extends EntityLivingBase> cls)
public void eatGrassBonus()
protected void entityInit()
entityInit in class EntityLivingBasepublic int getTalkInterval()
public void playLivingSound()
public void onEntityUpdate()
onEntityUpdate in class EntityLivingBaseprotected int getExperiencePoints(EntityPlayer player)
getExperiencePoints in class EntityLivingBasepublic void spawnExplosionParticle()
public void handleStatusUpdate(byte id)
handleStatusUpdate in class EntityLivingBasepublic void onUpdate()
onUpdate in class EntityLivingBaseprotected float func_110146_f(float p_110146_1_,
float p_110146_2_)
func_110146_f in class EntityLivingBaseprotected java.lang.String getLivingSound()
protected Item getDropItem()
protected void dropFewItems(boolean p_70628_1_,
int p_70628_2_)
dropFewItems in class EntityLivingBasepublic void writeEntityToNBT(NBTTagCompound tagCompound)
writeEntityToNBT in class EntityLivingBasepublic void readEntityFromNBT(NBTTagCompound tagCompund)
readEntityFromNBT in class EntityLivingBasepublic void setMoveForward(float p_70657_1_)
public void setAIMoveSpeed(float speedIn)
setAIMoveSpeed in class EntityLivingBasepublic void onLivingUpdate()
onLivingUpdate in class EntityLivingBaseprotected void updateEquipmentIfNeeded(EntityItem itemEntity)
protected boolean func_175448_a(ItemStack stack)
protected boolean canDespawn()
protected void despawnEntity()
protected final void updateEntityActionState()
updateEntityActionState in class EntityLivingBaseprotected void updateAITasks()
public int getVerticalFaceSpeed()
public void faceEntity(Entity entityIn, float p_70625_2_, float p_70625_3_)
public boolean getCanSpawnHere()
public boolean isNotColliding()
public float getRenderSizeModifier()
public int getMaxSpawnedInChunk()
public int getMaxFallHeight()
getMaxFallHeight in class Entitypublic ItemStack getHeldItem()
getHeldItem in class EntityLivingBasepublic ItemStack getEquipmentInSlot(int slotIn)
getEquipmentInSlot in class EntityLivingBasepublic ItemStack getCurrentArmor(int slotIn)
getCurrentArmor in class EntityLivingBasepublic void setCurrentItemOrArmor(int slotIn,
ItemStack stack)
setCurrentItemOrArmor in class EntityLivingBasepublic ItemStack[] getInventory()
getInventory in class EntityLivingBaseprotected void dropEquipment(boolean p_82160_1_,
int p_82160_2_)
dropEquipment in class EntityLivingBaseprotected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
public static int getArmorPosition(ItemStack stack)
public static Item getArmorItemForSlot(int armorSlot, int itemTier)
protected void setEnchantmentBasedOnDifficulty(DifficultyInstance difficulty)
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata)
public boolean canBeSteered()
public void enablePersistence()
public void setEquipmentDropChance(int slotIn,
float chance)
public boolean canPickUpLoot()
public void setCanPickUpLoot(boolean canPickup)
public boolean isNoDespawnRequired()
public final boolean interactFirst(EntityPlayer playerIn)
interactFirst in class Entityprotected boolean interact(EntityPlayer player)
protected void updateLeashedState()
public void clearLeashed(boolean sendPacket,
boolean dropLead)
public boolean allowLeashing()
public boolean getLeashed()
public Entity getLeashedToEntity()
public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification)
public boolean replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn)
replaceItemInInventory in class Entitypublic boolean isServerWorld()
isServerWorld in class EntityLivingBasepublic void setNoAI(boolean disable)
public boolean isAIDisabled()