Package net.minecraft.entity
Class EntityLiving
- java.lang.Object
 - 
- net.zxmushroom63.plugins.BaseData
 - 
- net.zxmushroom63.plugins.PluginData
 - 
- net.minecraft.entity.Entity
 - 
- net.minecraft.entity.EntityLivingBase
 - 
- net.minecraft.entity.EntityLiving
 
 
 
 
 
 
- 
- All Implemented Interfaces:
 org.teavm.jso.JSObject
- Direct Known Subclasses:
 EntityAmbientCreature,EntityCreature,EntityDragon,EntityFlying,EntitySlime,EntityWaterMob
public abstract class EntityLiving extends EntityLivingBase
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEntityLiving.SpawnPlacementType- 
Nested classes/interfaces inherited from class net.zxmushroom63.plugins.BaseData
BaseData.BooleanCallback, BaseData.BooleanCallbackArr, BaseData.DataBooleanCallback, BaseData.DataBooleanCallbackArr, BaseData.DataDoubleCallback, BaseData.DataDoubleCallbackArr, BaseData.DataFloatCallback, BaseData.DataFloatCallbackArr, BaseData.DataIntCallback, BaseData.DataIntCallbackArr, BaseData.DataObjectCallback, BaseData.DataObjectCallbackArr, BaseData.DataStringCallback, BaseData.DataStringCallbackArr, BaseData.DataVoidCallback, BaseData.DoubleCallback, BaseData.DoubleCallbackArr, BaseData.FloatCallback, BaseData.FloatCallbackArr, BaseData.IntCallback, BaseData.IntCallbackArr, BaseData.ObjectCallback, BaseData.ObjectCallbackArr, BaseData.StringCallback, BaseData.StringCallbackArr, BaseData.VoidCallback 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description protected float[]equipmentDropChances+ Chances for each equipment piece from dropping when this entity dies.protected intexperienceValueintlivingSoundTime- 
Fields inherited from class net.minecraft.entity.EntityLivingBase
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, swingProgressInt 
- 
Fields inherited from class net.minecraft.entity.Entity
addedToChunk, chunkCoordX, chunkCoordY, chunkCoordZ, dataWatcher, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, 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 Summary
Constructors Constructor Description EntityLiving(World worldIn) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowLeashing()protected voidapplyEntityAttributes()booleancanAttackClass(java.lang.Class<? extends EntityLivingBase> cls)+ Returns true if this entity can attack entities of the specified class.booleancanBeSteered()+ returns true if all the conditions for steering the entity are met.protected booleancanDespawn()+ Determines if an entity can be despawned, used on idle far away entitiesbooleancanPickUpLoot()voidclearLeashed(boolean sendPacket, boolean dropLead)+ Removes the leash from this entityprotected voiddespawnEntity()+ Makes the entity despawn if requirements are reachedprotected voiddropEquipment(boolean flag, int i)+ Drop the equipment for this entity.protected voiddropFewItems(boolean var1, int i)+ Drop 0-2 items of this living's typevoideatGrassBonus()+ This function applies the benefits of growing back wool and faster growing up to the acting entity.voidenablePersistence()+ Enable the Entity persistenceprotected voidentityInit()voidfaceEntity(Entity entityIn, float parFloat1, float parFloat2)+ Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument.protected floatfunc_110146_f(float var1, float f)protected booleanfunc_175448_a(ItemStack stack)static ItemgetArmorItemForSlot(int armorSlot, int itemTier)+ Gets the vanilla armor Item that can go in the slot specified for the given tier.static intgetArmorPosition(ItemStack stack)EntityLivingBasegetAttackTarget()+ Gets the active target the Task system uses for trackingbooleangetCanSpawnHere()+ Checks if the entity's current position is a valid location to spawn this entity.ItemStackgetCurrentArmor(int i)protected ItemgetDropItem()ItemStackgetEquipmentInSlot(int i)+ 0: Tool in Hand; 1-4: Armorprotected intgetExperiencePoints(EntityPlayer var1)+ Get the experience points the entity currently has.ItemStackgetHeldItem()+ Returns the item that this EntityLiving is holding, if any.ItemStack[]getInventory()+ returns the inventory of this entity (only used in EntityPlayerMP it seems)booleangetLeashed()EntitygetLeashedToEntity()protected java.lang.StringgetLivingSound()+ Returns the sound this mob makes while it's alive.intgetMaxFallHeight()+ The maximum height from where the entity is alowed to jump (used in pathfinder)intgetMaxSpawnedInChunk()+ Will return how many at most can spawn in a chunk at once.floatgetRenderSizeModifier()+ Returns render size modifierintgetTalkInterval()+ Get number of ticks, at least during which the living entity will be silent.intgetVerticalFaceSpeed()+ The speed it takes to move the entityliving's rotationPitch through the faceEntity method.voidhandleStatusUpdate(byte b0)protected booleaninteract(EntityPlayer var1)+ Called when a player interacts with a mob.booleaninteractFirst(EntityPlayer entityplayer)+ First layer of player interactionbooleanisAIDisabled()+ Get whether this Entity's AI is disabledbooleanisNoDespawnRequired()booleanisNotColliding()+ Checks that the entity is not colliding with any blocks / liquidsbooleanisServerWorld()+ Returns whether the entity is in a server worldvoidonEntityUpdate()+ Gets called every tick from main Entity classIEntityLivingDataonInitialSpawn(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.voidplayLivingSound()+ Plays living's sound at its positionvoidreadEntityFromNBT(NBTTagCompound nbttagcompound)+ (abstract) Protected helper method to read subclass entity data from NBT.booleanreplaceItemInInventory(int i, ItemStack itemstack)voidsetAIMoveSpeed(float f)+ set the movespeed used for the new AI systemvoidsetAttackTarget(EntityLivingBase entitylivingbaseIn)+ Sets the active target the Task system uses for trackingvoidsetCanPickUpLoot(boolean canPickup)voidsetCurrentItemOrArmor(int i, ItemStack itemstack)+ Sets the held item, or an armor slot.protected voidsetEnchantmentBasedOnDifficulty(DifficultyInstance difficulty)+ Enchants Entity's current equipments based on given DifficultyInstanceprotected voidsetEquipmentBasedOnDifficulty(DifficultyInstance difficulty)+ Gives armor or weapon for entity based on given DifficultyInstancevoidsetEquipmentDropChance(int slotIn, float chance)voidsetLeashedToEntity(Entity entityIn, boolean sendAttachNotification)+ Sets the entity to be leashed to.voidsetMoveForward(float parFloat1)voidsetNoAI(boolean disable)+ Set whether this Entity's AI is disabledvoidspawnExplosionParticle()+ Spawns an explosion particle around the Entity's locationprotected voidupdateAITasks()protected voidupdateEntityActionState()protected voidupdateEquipmentIfNeeded(EntityItem itemEntity)+ Tests if this entity should pickup a weapon or an armor.protected voidupdateLeashedState()+ Applies logic related to leashes, for example dragging the entity or breaking the leash.voidwriteEntityToNBT(NBTTagCompound nbttagcompound)+ (abstract) Protected helper method to write subclass entity data to NBT.- 
Methods inherited from class net.minecraft.entity.EntityLivingBase
addPotionEffect, addRandomDrop, applyArmorCalculations, applyPotionDamageCalculations, attackEntityAsMob, attackEntityFrom, canBeCollidedWith, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, 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, loadPluginData, makePluginData, markPotionsDirty, mountEntity, moveEntityWithHeading, onChangedPotionEffect, onDeath, onDeathUpdate, onFinishedPotionEffect, onItemPickup, onKillCommand, onLivingUpdate, onNewPotionEffect, onUpdate, performHurtAnimation, removePotionEffect, removePotionEffectClient, renderBrokenItemStack, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAbsorptionAmount, setArrowCountInEntity, setBeenAttacked, setHealth, setJumping, setLastAttacker, setPositionAndRotation2, setRevengeTarget, setRotationYawHead, setSprinting, swingItem, updateAITick, updateArmSwingProgress, updateFallState, updatePotionEffects, updatePotionMetadata, updateRidden 
- 
Methods inherited from class net.minecraft.entity.Entity
addChatMessage, addEntityCrashInfo, addToPlayerScore, addVelocity, applyEnchantments, applyEntityCollision, canAttackWithItem, canCommandSenderUseCommand, canRenderOnFire, canTriggerWalking, clientUpdateEntityNBT, copyDataFromOld, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, fromNBT, func_181012_aH, func_181014_aG, func_181015_d, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCustomNameTag, getDataWatcher, getDisplayName, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityId, getEntityString, getEntityWorld, getExplosionResistance, getEyeHeight, getFlag, getHorizontalFacing, getHoverEvent, getMaxInPortalTime, getMountedYOffset, getName, getNBTTagCompound, getParts, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getSplashSound, getSwimSound, getUniqueID, getVectorForRotation, getYOffset, handleWaterMovement, hasCustomName, hashCode, hitByEntity, interactAt, isBurning, isEating, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isOffsetPositionInLiquid, isOutsideBorder, isPushedByWater, isRiding, isSilent, isSneaking, isSprinting, isWet, moveEntity, moveFlying, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onChunkLoad, onCollideWithPlayer, onDataWatcherUpdate, onKillEntity, onStruckByLightning, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, rayTrace, readFromNBT, resetHeight, sendCommandFeedback, setAir, setAlwaysRenderNameTag, setAngles, setCustomNameTag, setDead, setEating, setEntityBoundingBox, setEntityId, setFire, setFlag, setInvisible, setInWeb, setLocationAndAngles, setOnFireFromLava, setOutsideBorder, setPosition, setPositionAndRotation, setPositionAndUpdate, setRotation, setSilent, setSize, setSneaking, setVelocity, setWorld, shouldSetPosAfterLoading, spawnRunningParticles, toNBT, toString, travelToDimension, updateRiderPosition, verifyExplosion, writeMountToNBT, writeToNBT, writeToNBTOptional 
- 
Methods inherited from class net.zxmushroom63.plugins.BaseData
execFuncBaseData, execFuncObject, execFuncString, getBaseData, getBaseDataArr, getBoolean, getBooleanArr, getByte, getByteArr, getChar, getCharArr, getDouble, getDoubleArr, getFloat, getFloatArr, getInt, getIntArr, getObject, getObjectArr, getShort, getShortArr, getString, getStringArr, has, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, set, setCallbackBoolean, setCallbackBooleanArr, setCallbackBooleanArrWithDataArg, setCallbackBooleanWithDataArg, setCallbackDouble, setCallbackDoubleArr, setCallbackDoubleArrWithDataArg, setCallbackDoubleWithDataArg, setCallbackFloat, setCallbackFloatArr, setCallbackFloatArrWithDataArg, setCallbackFloatWithDataArg, setCallbackInt, setCallbackIntArr, setCallbackIntArrWithDataArg, setCallbackIntWithDataArg, setCallbackObject, setCallbackObjectArr, setCallbackObjectArrWithDataArg, setCallbackObjectWithDataArg, setCallbackString, setCallbackStringArr, setCallbackStringArrWithDataArg, setCallbackStringWithDataArg, setCallbackVoid, setCallbackVoidWithDataArg, setNull 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
EntityLiving
public EntityLiving(World worldIn)
 
 - 
 
- 
Method Detail
- 
applyEntityAttributes
protected void applyEntityAttributes()
- Overrides:
 applyEntityAttributesin classEntityLivingBase
 
- 
getAttackTarget
public EntityLivingBase getAttackTarget()
+ Gets the active target the Task system uses for tracking 
- 
setAttackTarget
public void setAttackTarget(EntityLivingBase entitylivingbaseIn)
+ Sets the active target the Task system uses for tracking 
- 
canAttackClass
public boolean canAttackClass(java.lang.Class<? extends EntityLivingBase> cls)
+ 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) 
- 
entityInit
protected void entityInit()
- Overrides:
 entityInitin classEntityLivingBase
 
- 
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
protected int getExperiencePoints(EntityPlayer var1)
+ Get the experience points the entity currently has.- Overrides:
 getExperiencePointsin classEntityLivingBase
 
- 
spawnExplosionParticle
public void spawnExplosionParticle()
+ Spawns an explosion particle around the Entity's location 
- 
handleStatusUpdate
public void handleStatusUpdate(byte b0)
- Overrides:
 handleStatusUpdatein classEntityLivingBase
 
- 
func_110146_f
protected float func_110146_f(float var1, float f)- Overrides:
 func_110146_fin classEntityLivingBase
 
- 
getLivingSound
protected java.lang.String getLivingSound()
+ Returns the sound this mob makes while it's alive. 
- 
getDropItem
protected Item getDropItem()
 
- 
dropFewItems
protected void dropFewItems(boolean var1, int i)+ Drop 0-2 items of this living's type- Overrides:
 dropFewItemsin classEntityLivingBase
 
- 
writeEntityToNBT
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to write subclass entity data to NBT.- Overrides:
 writeEntityToNBTin classEntityLivingBase
 
- 
readEntityFromNBT
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to read subclass entity data from NBT.- Overrides:
 readEntityFromNBTin classEntityLivingBase
 
- 
setMoveForward
public void setMoveForward(float parFloat1)
 
- 
setAIMoveSpeed
public void setAIMoveSpeed(float f)
+ set the movespeed used for the new AI system- Overrides:
 setAIMoveSpeedin classEntityLivingBase
 
- 
updateEquipmentIfNeeded
protected void updateEquipmentIfNeeded(EntityItem itemEntity)
+ Tests if this entity should pickup a weapon or an armor. Entity drops current weapon or armor if the new one is better. 
- 
func_175448_a
protected boolean func_175448_a(ItemStack stack)
 
- 
canDespawn
protected boolean canDespawn()
+ Determines if an entity can be despawned, used on idle far away entities 
- 
despawnEntity
protected void despawnEntity()
+ Makes the entity despawn if requirements are reached 
- 
updateEntityActionState
protected final void updateEntityActionState()
- Overrides:
 updateEntityActionStatein classEntityLivingBase
 
- 
updateAITasks
protected void updateAITasks()
 
- 
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
public void faceEntity(Entity entityIn, float parFloat1, float parFloat2)
+ Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument. 
- 
getCanSpawnHere
public boolean getCanSpawnHere()
+ Checks if the entity's current position is a valid location to spawn this entity. 
- 
isNotColliding
public boolean isNotColliding()
+ Checks that the entity is not colliding with any blocks / liquids 
- 
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. 
- 
getMaxFallHeight
public int getMaxFallHeight()
+ The maximum height from where the entity is alowed to jump (used in pathfinder)- Overrides:
 getMaxFallHeightin classEntity
 
- 
getHeldItem
public ItemStack getHeldItem()
+ Returns the item that this EntityLiving is holding, if any.- Specified by:
 getHeldItemin classEntityLivingBase
 
- 
getEquipmentInSlot
public ItemStack getEquipmentInSlot(int i)
+ 0: Tool in Hand; 1-4: Armor- Specified by:
 getEquipmentInSlotin classEntityLivingBase
 
- 
getCurrentArmor
public ItemStack getCurrentArmor(int i)
- Specified by:
 getCurrentArmorin classEntityLivingBase
 
- 
setCurrentItemOrArmor
public void setCurrentItemOrArmor(int i, ItemStack itemstack)+ 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
 
- 
getInventory
public ItemStack[] getInventory()
+ returns the inventory of this entity (only used in EntityPlayerMP it seems)- Specified by:
 getInventoryin classEntityLivingBase
 
- 
dropEquipment
protected void dropEquipment(boolean flag, int i)+ Drop the equipment for this entity.- Overrides:
 dropEquipmentin classEntityLivingBase
 
- 
setEquipmentBasedOnDifficulty
protected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
+ Gives armor or weapon for entity based on given DifficultyInstance 
- 
getArmorPosition
public static int getArmorPosition(ItemStack stack)
 
- 
getArmorItemForSlot
public static Item getArmorItemForSlot(int armorSlot, int itemTier)
+ Gets the vanilla armor Item that can go in the slot specified for the given tier. 
- 
setEnchantmentBasedOnDifficulty
protected void setEnchantmentBasedOnDifficulty(DifficultyInstance difficulty)
+ Enchants Entity's current equipments based on given DifficultyInstance 
- 
onInitialSpawn
public 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. Mainly used for initializing attributes and inventory 
- 
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 
- 
enablePersistence
public void enablePersistence()
+ Enable the Entity persistence 
- 
setEquipmentDropChance
public void setEquipmentDropChance(int slotIn, float chance) 
- 
canPickUpLoot
public boolean canPickUpLoot()
 
- 
setCanPickUpLoot
public void setCanPickUpLoot(boolean canPickup)
 
- 
isNoDespawnRequired
public boolean isNoDespawnRequired()
 
- 
interactFirst
public final boolean interactFirst(EntityPlayer entityplayer)
+ First layer of player interaction- Overrides:
 interactFirstin classEntity
 
- 
interact
protected boolean interact(EntityPlayer var1)
+ Called when a player interacts with a mob. e.g. gets milk from a cow, gets into the saddle on a pig. 
- 
updateLeashedState
protected void updateLeashedState()
+ Applies logic related to leashes, for example dragging the entity or breaking the leash. 
- 
clearLeashed
public void clearLeashed(boolean sendPacket, boolean dropLead)+ Removes the leash from this entity 
- 
allowLeashing
public boolean allowLeashing()
 
- 
getLeashed
public boolean getLeashed()
 
- 
getLeashedToEntity
public Entity getLeashedToEntity()
 
- 
setLeashedToEntity
public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification)
+ Sets the entity to be leashed to. 
- 
replaceItemInInventory
public boolean replaceItemInInventory(int i, ItemStack itemstack)- Overrides:
 replaceItemInInventoryin classEntity
 
- 
isServerWorld
public boolean isServerWorld()
+ Returns whether the entity is in a server world- Overrides:
 isServerWorldin classEntityLivingBase
 
- 
setNoAI
public void setNoAI(boolean disable)
+ Set whether this Entity's AI is disabled 
- 
isAIDisabled
public boolean isAIDisabled()
+ Get whether this Entity's AI is disabled 
 - 
 
 -