Package net.minecraft.src
Class EntityLiving
java.lang.Object
net.minecraft.src.Entity
net.minecraft.src.EntityLivingBase
net.minecraft.src.EntityLiving
- Direct Known Subclasses:
EntityAmbientCreature,EntityCreature,EntityDragon,EntityFlying,EntitySlime
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected floatprotected float[]Chances for each equipment piece from dropping when this entity dies.protected intThe experience points the Entity gives.protected static final intintNumber of ticks since this mouseOverCustomRayTraceEntityLiving last produced its soundprotected intHow long to keep a specific target entityprotected final EntityAITasksprotected final EntityAITasksFields inherited from class net.minecraft.src.EntityLivingBase
arrowHitTimer, attackedAtYaw, attackingPlayer, attackTime, cameraPitch, dead, deathTime, entityAge, entityLivingToAttack, field_110154_aX, field_70741_aB, field_70763_ax, field_70764_aw, field_70768_au, field_70769_ao, field_70770_ap, hurtTime, isJumping, isLivingDead, isSwingInProgress, jumpMovementFactor, landMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, moveForward, moveStrafing, newPosRotationIncrements, newPosX, newPosY, newPosZ, newRotationPitch, newRotationYaw, onChoppingBlockMaxCountdown, prevCameraPitch, prevHealth, prevLimbSwingAmount, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomYawVelocity, recentlyHit, recentlyOnChoppingBlockCountdown, renderYawOffset, revengeCountdown, revengeTimer, rotationYawHead, scoreValue, swingProgress, swingProgressIntFields inherited from class net.minecraft.src.Entity
addedToChunk, boundingBox, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityId, fallDistance, field_70135_K, fireResistance, forceSpawn, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, isDead, isImmuneToFire, isInWeb, lastGroundPosX, lastGroundPosY, lastGroundPosZ, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, myEntitySize, nextBlockCheckDistance, 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidMakes entity wear random armor based on difficultybooleanprotected voidbooleanattackEntityAsMob(Entity par1Entity) booleanbooleancanAttackClass(Class par1Class) Returns true if this entity can attack entities of the specified class.booleanreturns true if all the conditions for steering the entity are met.protected booleanDetermines if an entity can be despawned, used on idle far away entitiesbooleancanEntityCenterOfMassBeSeen(Entity entity) booleanvoidclearLeashed(boolean par1, boolean par2) Removes the leash from this entity.protected voidbooleanprotected voiddropEquipment(boolean par1, int par2) Drop the equipment for this entity.protected voiddropFewItems(boolean par1, int par2) Drop 0-2 items of this living's type.voidThis function applies the benefits of growing back wool and faster growing up to the acting entity.protected voidEnchants the entity's armor and held item based on difficultyprotected voidprotected voidprotected voidentityLivingDropFewItems(boolean par1, int par2) protected voidentityLivingOnSpawnWithEgg(EntityLivingData par1EntityLivingData) protected voidentityLivingSetAttackTarget(EntityLivingBase par1EntityLiving) protected voidvoidfaceEntity(Entity par1Entity, float par2, float par3) Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument.protected floatfunc_110146_f(float par1, float par2) protected voidvoidfunc_130225_q(int par1) booleanbooleangetArmorItemForSlot(int par0, int par1) static intgetArmorPosition(ItemStack par0ItemStack) Gets the active target the Task system uses for trackingbooleanChecks if the entity's current position is a valid location to spawn this entity.getCurrentArmorBTW(int par1) getCurrentItemOrArmor(int par1) 0 = item, 1-n is armorprotected intReturns the item ID for the item the mob drops on death.Gets the username of the entity.returns the EntitySenses Object for the EntityLivingprotected intgetExperiencePoints(EntityPlayer par1EntityPlayer) Get the experience points the entity currently has.Returns the item that this EntityLiving is holding, if any.booleanprotected StringReturns the sound this mob makes while it's alive.intThe number of iterations PathFinder.getSafePoint will execute before giving up.intWill return how many at most can spawn in a chunk at once.floatReturns render size modifierintGet number of ticks, at least during which the living entity will be silent.intThe speed it takes to move the entityliving's rotationPitch through the faceEntity method.booleanUses dataWatcher to tell if this entity has a target.booleanstatic booleanprotected booleaninteract(EntityPlayer par1EntityPlayer) Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig.final booleaninteractFirst(EntityPlayer par1EntityPlayer) First layer of player interactionprotected booleanReturns true if the newer Entity AI code should be runprotected booleanisInsideSpawnAreaAroundChunk(int iChunkX, int iChunkZ) protected booleanprotected booleanbooleanbooleanmeleeAttack(Entity target) protected doubleprotected voidvoidvoidGets called every tick from main Entity classvoidvoidvoidCalled frequently so the entity can update its state every tick as required.onSpawnWithEgg(EntityLivingData par1EntityLivingData) voidonUpdate()Called to update the entity's position/logic.voidvoidPlays living's sound at its positionvoidInitialize state variables which may affect ability to spawn, such as bounding box sizevoidreadEntityFromNBT(NBTTagCompound par1NBTTagCompound) (abstract) Protected helper method to read subclass entity data from NBT.voidsetAIMoveSpeed(float par1) set the movespeed used for the new AI systemvoidsetAlwaysRenderNameTag(boolean par1) voidsetAttackTarget(EntityLivingBase par1EntityLivingBase) Sets the active target the Task system uses for trackingvoidsetCanPickUpLoot(boolean par1) voidsetCurrentItemOrArmor(int par1, ItemStack par2ItemStack) Sets the held item, or an armor slot.voidsetCustomNameTag(String par1Str) voidsetEquipmentDropChance(int par1, float par2) voidsetLeashedToEntity(Entity par1Entity, boolean par2) Sets the entity to be leashed to.voidsetMoveForward(float par1) voidsetPersistent(boolean bPersistant) voidvoidSpawns an explosion particle around the Entity's locationprotected voidprotected voidvoidwriteEntityToNBT(NBTTagCompound par1NBTTagCompound) // +++START EDIT+++ // ---END EDIT--- (abstract) Protected helper method to write subclass entity data to NBT.Methods inherited from class net.minecraft.src.EntityLivingBase
addPotionEffect, applyArmorCalculations, applyPotionDamageCalculations, attackEntityFrom, canBeCollidedWith, canBePushed, canBreatheUnderwater, canEntityBeSeen, canJump, canJumpMidWater, canSwim, checkForHeadDrop, checkForRareDrop, checkForScrollDrop, clearActivePotions, collideWithEntity, collideWithNearbyEntities, damageArmor, damageEntity, decreaseAirSupply, dismountEntity, dropHead, dropRareDrop, entityLivingBaseFall, entityLivingOnDeath, fall, func_110142_aN, func_142015_aE, func_94060_bK, getAbsorptionAmount, getActivePotionEffect, getActivePotionEffects, getAge, getAIMoveSpeed, getAITarget, getAmbientLootingModifier, getArrowCountInEntity, getAttributeMap, getCreatureAttribute, getDeathSound, getDefaultSlipperinessOnGround, getEntityAttribute, getEyeHeight, getHealth, getHealthAndExhaustionModifier, getHurtSound, getItemIcon, getLadderVerticalMovementModifier, getLandMovementModifier, getLastAttacker, getLastAttackerTime, getLook, getLookVec, getMaxHealth, getMeleeAttackStrength, getPosition, getRNG, getRotationYawHead, getSlipperinessRelativeToBlock, getSoundPitch, getSoundVolume, getSpeedModifier, getSwimmingHorizontalModifier, getSwingProgress, getTeam, getTotalArmorValue, handleHealthUpdate, heal, isChild, isClientWorld, isEntityAlive, isEntityUndead, isMovementBlocked, isOnLadder, isOnSameTeam, isOnTeam, isPlayer, isPlayerSleeping, isPotionActive, isPotionActive, isPotionApplicable, isWeighted, isWeightedByHeadCrab, jump, kill, knockBack, knockbackMagnitude, mouseOverCustomRayTrace, moveEntityWithHeading, onChangedPotionEffect, onDeath, onDeathUpdate, onFinishedPotionEffect, onItemPickup, onNewPotionEffect, performHurtAnimation, rayTrace, recoverAirSupply, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, setAbsorptionAmount, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setPositionAndUpdate, setRevengeTarget, setRotationYawHead, setSprinting, swingItem, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffects, updateRiddenMethods inherited from class net.minecraft.src.Entity
addComponent, addEntityCrashInfo, addToPlayerScore, addVelocity, appliesConstantForceWhenRidingBoat, applyEntityCollision, canAttackWithItem, canCollideWithEntity, canEntityTriggerTripwire, canRenderOnFire, canTriggerWalking, copyDataFrom, copyLocationAndAnglesFrom, dealFireDamage, doBlockCollisions, doesEntityApplyToSquidPossessionCap, doesEntityNotTriggerPressurePlate, doesNotDismountInWater, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, flagAllWatchedObjectsDirty, flingAwayFromEntity, getAir, getAnimalKickMovementMultiplier, getBlockExplosionResistance, getBoundingBox, getBrightness, getBrightnessForRender, getCanBeHeadCrabbed, getCollisionBorderSize, getCollisionBox, getComponent, getDataWatcher, getDistance, getDistanceSq, getDistanceSqToEntity, getDistanceToEntity, getEntityString, getFlag, getHeadCrabSharedAttackTarget, getMaxInPortalTime, getMountedYOffset, getParts, getPortalCooldown, getShadowSize, getTeleportDirection, getTranslatedEntityName, getUniqueID, getVisualBoundingBox, getXZDistanceSqToEntity, getYOffset, handleLavaMovement, handleWaterMovement, hasComponent, hashCode, hasHeadCrabbedSquid, hitByEntity, initComponents, isAffectedByMovementModifiers, isBeingRainedOn, isBurning, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInsideOpaqueBlock, isEntityInsideSuffocatingBlock, isEntityInsideSuffocatingBlock, isEntityInvulnerable, isImmuneToFire, isImmuneToHeadCrabDamage, isInRangeToRenderDist, isInRangeToRenderVec3D, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isItemEntity, isOffsetPositionInLiquid, isPushedByWater, isRiding, isSecondaryTargetForSquid, isSneaking, isSprinting, isUsingSpecialKey, isValidOngoingAttackTargetForSquid, isValidZombieSecondaryTarget, isWet, mountEntity, mountEntityRemote, moveEntity, moveFlying, movementModifierWhenRidingBoat, newDoubleNBTList, newFloatNBTList, notifyOfWolfHowl, onBlockDispenserConsume, onChunkLoad, onCollideWithPlayer, onKickedByAnimal, onKillEntity, onPossessedRidingEntityDeath, onStruckByLightning, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, readFromNBT, setAir, setAngles, setDead, setEating, setFire, setFlag, setInPortal, setInvisible, setInWeb, setLocationAndAngles, setOnFireFromLava, setPosition, setPositionAndRotation, setRotation, setSize, setSneaking, setVelocity, setWorld, shouldExplodeBlock, shouldSetPosAfterLoading, shouldSetPositionOnLoad, toString, travelToDimension, tryToSetFireToBlocksInContact, updateCloak, updateRiderPosition, writeMountToNBT, writeToNBT, writeToNBTOptional
-
Field Details
-
livingSoundTime
public int livingSoundTimeNumber of ticks since this mouseOverCustomRayTraceEntityLiving last produced its sound -
HAS_ATTACK_TARGET_DATA_WATCHER_ID
protected static final int HAS_ATTACK_TARGET_DATA_WATCHER_ID- See Also:
-
experienceValue
protected int experienceValueThe experience points the Entity gives. -
tasks
-
targetTasks
-
equipmentDropChances
protected float[] equipmentDropChancesChances for each equipment piece from dropping when this entity dies. -
defaultPitch
protected float defaultPitch -
numTicksToChaseTarget
protected int numTicksToChaseTargetHow long to keep a specific target entity
-
-
Constructor Details
-
EntityLiving
-
-
Method Details
-
applyEntityAttributes
protected void applyEntityAttributes()- Overrides:
applyEntityAttributesin classEntityLivingBase
-
func_110146_f
protected float func_110146_f(float par1, float par2) - Overrides:
func_110146_fin classEntityLivingBase
-
dropFewItems
protected void dropFewItems(boolean par1, int par2) Drop 0-2 items of this living's type. @param par1 - Whether this entity has recently been hit by a player. @param par2 - Level of Looting used to kill this mob.- Overrides:
dropFewItemsin classEntityLivingBase
-
setAIMoveSpeed
public void setAIMoveSpeed(float par1) set the movespeed used for the new AI system- Overrides:
setAIMoveSpeedin classEntityLivingBase
-
getLookHelper
-
getMoveHelper
-
getJumpHelper
-
getEntitySenses
returns the EntitySenses Object for the EntityLiving -
enchantEquipment
protected void enchantEquipment()Enchants the entity's armor and held item based on difficulty -
onSpawnWithEgg
-
entityLivingOnSpawnWithEgg
-
getAttackTarget
Gets the active target the Task system uses for tracking -
hasAttackTarget
public boolean hasAttackTarget()Uses dataWatcher to tell if this entity has a target. -
func_110163_bv
public void func_110163_bv() -
attackEntityAsMob
- Overrides:
attackEntityAsMobin classEntityLivingBase
-
meleeAttack
-
setAttackTarget
Sets the active target the Task system uses for tracking -
entityLivingSetAttackTarget
-
canAttackClass
Returns true if this entity can attack entities of the specified class. -
eatGrassBonus
public void eatGrassBonus()This function applies the benefits of growing back wool and faster growing up to the acting entity. (This function is used in the AIEatGrass) -
interactFirst
First layer of player interaction- Overrides:
interactFirstin classEntity
-
entityInit
protected void entityInit()- Overrides:
entityInitin classEntityLivingBase
-
interact
Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. -
func_110159_bB
protected void func_110159_bB() -
clearLeashed
public void clearLeashed(boolean par1, boolean par2) Removes the leash from this entity. Second parameter tells whether to send a packet to surrounding players. -
allowLeashing
public boolean allowLeashing() -
getLeashed
public boolean getLeashed() -
getLeashedToEntity
-
setLeashedToEntity
Sets the entity to be leashed to.\nArgs:\n@param par1Entity: The entity to be tethered to.\n@param par2: Whether to send an attaching notification packet to surrounding players. -
getTalkInterval
public int getTalkInterval()Get number of ticks, at least during which the living entity will be silent. -
playLivingSound
public void playLivingSound()Plays living's sound at its position -
onEntityUpdate
public void onEntityUpdate()Gets called every tick from main Entity class- Overrides:
onEntityUpdatein classEntityLivingBase
-
getExperiencePoints
Get the experience points the entity currently has.- Overrides:
getExperiencePointsin classEntityLivingBase
-
spawnExplosionParticle
public void spawnExplosionParticle()Spawns an explosion particle around the Entity's location -
onUpdate
public void onUpdate()Called to update the entity's position/logic.- Overrides:
onUpdatein classEntityLivingBase
-
getLivingSound
Returns the sound this mob makes while it's alive. -
entityLivingDropFewItems
protected void entityLivingDropFewItems(boolean par1, int par2) -
getDropItemId
protected int getDropItemId()Returns the item ID for the item the mob drops on death. -
writeEntityToNBT
// +++START EDIT+++ // ---END EDIT--- (abstract) Protected helper method to write subclass entity data to NBT.- Overrides:
writeEntityToNBTin classEntityLivingBase
-
readEntityFromNBT
(abstract) Protected helper method to read subclass entity data from NBT.- Overrides:
readEntityFromNBTin classEntityLivingBase
-
setMoveForward
public void setMoveForward(float par1) -
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.- Overrides:
onLivingUpdatein classEntityLivingBase
-
entityLivingOnLivingUpdate
protected void entityLivingOnLivingUpdate() -
isAIEnabled
protected boolean isAIEnabled()Returns true if the newer Entity AI code should be run- Overrides:
isAIEnabledin classEntityLivingBase
-
canDespawn
protected boolean canDespawn()Determines if an entity can be despawned, used on idle far away entities -
updateAITasks
protected void updateAITasks()- Overrides:
updateAITasksin classEntityLivingBase
-
entityLivingUpdateAITasks
protected void entityLivingUpdateAITasks() -
updateEntityActionState
protected void updateEntityActionState()- Overrides:
updateEntityActionStatein classEntityLivingBase
-
getVerticalFaceSpeed
public int getVerticalFaceSpeed()The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently use in wolves. -
faceEntity
Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument. -
isNoDespawnRequired
public boolean isNoDespawnRequired() -
getCanSpawnHere
public boolean getCanSpawnHere()Checks if the entity's current position is a valid location to spawn this entity. -
getRenderSizeModifier
public float getRenderSizeModifier()Returns render size modifier -
getMaxSpawnedInChunk
public int getMaxSpawnedInChunk()Will return how many at most can spawn in a chunk at once. -
getMaxSafePointTries
public int getMaxSafePointTries()The number of iterations PathFinder.getSafePoint will execute before giving up.- Overrides:
getMaxSafePointTriesin classEntity
-
getHeldItem
Returns the item that this EntityLiving is holding, if any.- Specified by:
getHeldItemin classEntityLivingBase
-
getCurrentItemOrArmor
0 = item, 1-n is armor- Specified by:
getCurrentItemOrArmorin classEntityLivingBase
-
func_130225_q
-
getCurrentArmorBTW
-
setCurrentItemOrArmor
Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot- Specified by:
setCurrentItemOrArmorin classEntityLivingBase
-
getLastActiveItems
- Specified by:
getLastActiveItemsin classEntityLivingBase
-
dropEquipment
protected void dropEquipment(boolean par1, int par2) Drop the equipment for this entity.- Overrides:
dropEquipmentin classEntityLivingBase
-
addRandomArmor
protected void addRandomArmor()Makes entity wear random armor based on difficulty -
entityLivingAddRandomArmor
protected void entityLivingAddRandomArmor() -
getArmorPosition
-
canBeSteered
public boolean canBeSteered()returns true if all the conditions for steering the entity are met. For pigs, this is true if it is being ridden by a player and the player is holding a carrot-on-a-stick -
getEntityName
Gets the username of the entity.- Overrides:
getEntityNamein classEntity
-
setCustomNameTag
-
getCustomNameTag
-
hasCustomNameTag
public boolean hasCustomNameTag() -
setAlwaysRenderNameTag
public void setAlwaysRenderNameTag(boolean par1) -
getAlwaysRenderNameTag
public boolean getAlwaysRenderNameTag() -
getAlwaysRenderNameTagForRender
public boolean getAlwaysRenderNameTagForRender()- Overrides:
getAlwaysRenderNameTagForRenderin classEntityLivingBase
-
setEquipmentDropChance
public void setEquipmentDropChance(int par1, float par2) -
canPickUpLoot
public boolean canPickUpLoot() -
setCanPickUpLoot
public void setCanPickUpLoot(boolean par1) -
modSpecificOnLivingUpdate
protected void modSpecificOnLivingUpdate() -
getArmorItemForSlot
-
onFlungBySquidTentacle
- Overrides:
onFlungBySquidTentaclein classEntity
-
onHeadCrabbedBySquid
- Overrides:
onHeadCrabbedBySquidin classEntity
-
spawnerInitCreature
public void spawnerInitCreature() -
preInitCreature
public void preInitCreature()Initialize state variables which may affect ability to spawn, such as bounding box size -
canEntityCenterOfMassBeSeen
-
setPersistent
public void setPersistent(boolean bPersistant) -
doesEntityApplyToSpawnCap
public boolean doesEntityApplyToSpawnCap()- Overrides:
doesEntityApplyToSpawnCapin classEntity
-
outOfUpdateRangeUpdate
public void outOfUpdateRangeUpdate()- Overrides:
outOfUpdateRangeUpdatein classEntity
-
onClimbWhileSwimming
public void onClimbWhileSwimming() -
despawnEntity
protected void despawnEntity() -
minDistFromPlayerForDespawn
protected double minDistFromPlayerForDespawn() -
isInsideSpawnAreaAroundPlayer
-
isInsideSpawnAreaAroundOriginalSpawn
protected boolean isInsideSpawnAreaAroundOriginalSpawn() -
isInsideSpawnAreaAroundChunk
protected boolean isInsideSpawnAreaAroundChunk(int iChunkX, int iChunkZ) -
attractsLightning
public boolean attractsLightning()- Overrides:
attractsLightningin classEntity
-
installationIntegrityTest
public static boolean installationIntegrityTest()
-