public abstract class EntityLiving extends EntityLivingBase
| Modifier and Type | Class and Description |
|---|---|
static class |
EntityLiving.SpawnPlacementType |
| Modifier and Type | Field and Description |
|---|---|
protected int |
experienceValue
The experience points the Entity gives.
|
protected float[] |
inventoryArmorDropChances
Chances for armor dropping when this entity dies.
|
protected float[] |
inventoryHandsDropChances
Chances for equipment in hands dropping when this entity dies.
|
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
(Usually one-shot) tasks used to select an attack target
|
EntityAITasks |
tasks
Active AI tasks (moving, looking, attack the target selected by
targetTasks, etc.) |
activeItemStack, activeItemStackUseCount, arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, HAND_STATES, hurtTime, idleTime, interpTargetPitch, interpTargetX, interpTargetY, interpTargetYaw, interpTargetZ, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, moveVertical, newPosRotationIncrements, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomUnused1, randomUnused2, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, SWIM_SPEED, swingingHand, swingProgress, swingProgressInt, ticksElytraFlying, ticksSinceLastSwing, unused180addedToChunk, cachedUniqueIdString, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, collided, collidedHorizontally, collidedVertically, dataManager, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, firstUpdate, FLAGS, forceSpawn, glowing, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isDead, isImmuneToFire, isInWeb, lastPortalPos, lastPortalVec, lastTickPosX, lastTickPosY, lastTickPosZ, motionX, motionY, motionZ, noClip, onGround, portalCounter, posX, posY, posZ, prevDistanceWalkedModified, preventEntitySpawning, prevPosX, prevPosY, prevPosZ, prevRotationPitch, prevRotationYaw, rand, rideCooldown, rotationPitch, rotationYaw, serverPosX, serverPosY, serverPosZ, stepHeight, teleportDirection, ticksExisted, timeUntilPortal, updateBlocked, velocityChanged, width, world| Constructor and Description |
|---|
EntityLiving(World worldIn) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyEntityAttributes() |
boolean |
canAttackClass(java.lang.Class<? extends EntityLivingBase> cls)
Returns true if this entity can attack entities of the specified class.
|
boolean |
canBeLeashedTo(EntityPlayer player) |
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
|
protected boolean |
canEquipItem(ItemStack stack) |
boolean |
canPassengerSteer() |
boolean |
canPickUpLoot() |
void |
clearLeashed(boolean sendPacket,
boolean dropLead)
Removes the leash from this entity
|
protected EntityBodyHelper |
createBodyHelper() |
protected PathNavigate |
createNavigator(World worldIn)
Returns new PathNavigateGround instance
|
protected void |
despawnEntity()
Makes the entity despawn if requirements are reached
|
protected void |
dropEquipment(boolean wasRecentlyHit,
int lootingModifier)
Drop the equipment for this entity.
|
protected void |
dropFewItems(boolean wasRecentlyHit,
int lootingModifier)
Drop 0-2 items of this living's type
|
protected void |
dropLoot(boolean wasRecentlyHit,
int lootingModifier,
DamageSource source)
drops the loot of this entity upon death
|
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 maxYawIncrease,
float maxPitchIncrease)
Changes pitch and yaw so that the entity calling the function is facing the entity provided as an argument.
|
protected SoundEvent |
getAmbientSound() |
static Item |
getArmorByChance(EntityEquipmentSlot slotIn,
int chance) |
java.lang.Iterable<ItemStack> |
getArmorInventoryList() |
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.
|
protected Item |
getDropItem() |
EntitySenses |
getEntitySenses()
returns the EntitySenses Object for the EntityLiving
|
protected int |
getExperiencePoints(EntityPlayer player)
Get the experience points the entity currently has.
|
java.lang.Iterable<ItemStack> |
getHeldEquipment() |
int |
getHorizontalFaceSpeed() |
ItemStack |
getItemStackFromSlot(EntityEquipmentSlot slotIn) |
EntityJumpHelper |
getJumpHelper() |
boolean |
getLeashed() |
Entity |
getLeashHolder() |
EntityLookHelper |
getLookHelper() |
protected ResourceLocation |
getLootTable() |
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() |
float |
getPathPriority(PathNodeType nodeType) |
EnumHandSide |
getPrimaryHand() |
float |
getRenderSizeModifier()
Returns render size modifier
|
static EntityEquipmentSlot |
getSlotForItemStack(ItemStack stack) |
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 void |
initEntityAI() |
boolean |
isAIDisabled()
Get whether this Entity's AI is disabled
|
static boolean |
isItemStackInSlot(EntityEquipmentSlot slotIn,
ItemStack stack) |
boolean |
isLeftHanded() |
boolean |
isNoDespawnRequired()
Return the persistenceRequired field (whether this entity is allowed to naturally despawn)
|
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.
|
protected void |
playHurtSound(DamageSource source) |
void |
playLivingSound()
Plays living's sound at its position
|
boolean |
processInitialInteract(EntityPlayer player,
EnumHand hand) |
protected boolean |
processInteract(EntityPlayer player,
EnumHand hand) |
void |
readEntityFromNBT(NBTTagCompound compound)
(abstract) Protected helper method to read subclass entity data from NBT.
|
static void |
registerFixesMob(DataFixer fixer,
java.lang.Class<?> name) |
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 |
setDropChance(EntityEquipmentSlot slotIn,
float chance) |
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 |
setItemStackToSlot(EntityEquipmentSlot slotIn,
ItemStack stack) |
void |
setLeashHolder(Entity entityIn,
boolean sendAttachNotification)
Sets the entity to be leashed to.
|
void |
setLeftHanded(boolean leftHanded) |
void |
setMoveForward(float amount) |
void |
setMoveStrafing(float amount) |
void |
setMoveVertical(float amount) |
void |
setNoAI(boolean disable)
Set whether this Entity's AI is disabled
|
void |
setPathPriority(PathNodeType nodeType,
float priority) |
void |
spawnExplosionParticle()
Spawns an explosion particle around the Entity's location
|
boolean |
startRiding(Entity entityIn,
boolean force) |
protected void |
updateAITasks() |
protected float |
updateDistance(float p_110146_1_,
float p_110146_2_) |
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 compound)
(abstract) Protected helper method to write subclass entity data to NBT.
|
addPotionEffect, applyArmorCalculations, applyPotionDamageCalculations, areAllPotionsAmbient, attackable, attackEntityAsMob, attackEntityFrom, attemptTeleport, blockUsingShield, canBeCollidedWith, canBeHitWithPotion, canBePushed, canBreatheUnderwater, canDropLoot, canEntityBeSeen, clearActivePotions, collideWithEntity, collideWithNearbyEntities, curePotionEffects, damageArmor, damageEntity, damageShield, decreaseAirSupply, dismountEntity, dismountRidingEntity, fall, frostWalk, getAbsorptionAmount, getActiveHand, getActiveItemStack, getActivePotionEffect, getActivePotionEffects, getActivePotionMap, getAIMoveSpeed, getAlwaysRenderNameTagForRender, getArrowCountInEntity, getAttackingEntity, getAttributeMap, getCapability, getCombatTracker, getCreatureAttribute, getDeathSound, getEntityAttribute, getFallSound, getHealth, getHeldItem, getHeldItemMainhand, getHeldItemOffhand, getHurtSound, getIdleTime, getItemInUseCount, getItemInUseMaxCount, getJumpUpwardsMotion, getLastAttackedEntity, getLastAttackedEntityTime, getLastDamageSource, getLook, getMaxHealth, getRevengeTarget, getRevengeTimer, getRNG, getRotationYawHead, getSoundPitch, getSoundVolume, getSwingProgress, getTicksElytraFlying, getTotalArmorValue, getWaterSlowDown, handleJumpLava, handleJumpWater, hasCapability, hasItemInSlot, heal, isActiveItemStackBlocking, isChild, isElytraFlying, isEntityAlive, isEntityUndead, isHandActive, isMovementBlocked, isOnLadder, isPlayer, isPlayerSleeping, isPotionActive, isPotionApplicable, jump, knockBack, markPotionsDirty, markVelocityChanged, moveRelative, notifyDataManagerChange, onChangedPotionEffect, onDeath, onDeathUpdate, onFinishedPotionEffect, onItemPickup, onItemUseFinish, onKillCommand, onNewPotionEffect, outOfWorld, performHurtAnimation, playEquipSound, removeActivePotionEffect, removePotionEffect, renderBrokenItemStack, resetActiveHand, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAbsorptionAmount, setActiveHand, setArrowCountInEntity, setHealth, setHeldItem, setJumping, setLastAttackedEntity, setPartying, setPositionAndRotationDirect, setRenderYawOffset, setRevengeTarget, setRotationYawHead, setSprinting, shouldRiderFaceForward, stopActiveHand, swingArm, travel, updateActiveHand, updateArmSwingProgress, updateFallState, updateItemUse, updatePotionEffects, updatePotionMetadata, updateRiddenaddEntityCrashInfo, addPassenger, addTag, addTrackingPlayer, addVelocity, applyEnchantments, applyEntityCollision, applyOrientationToEntity, applyPlayerInteraction, awardKillScore, canBeAttackedWithItem, canBeRidden, canExplosionDestroyBlock, canFitPassenger, canRenderOnFire, canRiderInteract, canTrample, canTriggerWalking, canUseCommand, changeDimension, changeDimension, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, decrementTimeUntilPortal, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, doWaterSplashEffect, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAdjustedHorizontalFacing, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCachedUniqueIdString, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getControllingPassenger, getCustomNameTag, getDataManager, getDisplayName, getDistance, getDistance, getDistanceSq, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getEquipmentAndArmor, getExplosionResistance, getEyeHeight, getFireImmuneTicks, getFlag, getForward, getHorizontalFacing, getHoverEvent, getIsInvulnerable, getLastPortalVec, getLookVec, getLowestRidingEntity, getMaxInPortalTime, getMirroredYaw, getMountedYOffset, getName, getParts, getPassengers, getPersistentID, getPickedResult, getPitchYaw, getPortalCooldown, getPosition, getPositionEyes, getPositionVector, getPushReaction, getRecursivePassengers, getRecursivePassengersByType, getRenderBoundingBox, getRenderDistanceWeight, getRidingEntity, getRotatedYaw, getServer, getSoundCategory, getSplashSound, getSwimSound, getTags, getTeam, getTeleportDirection, getUniqueID, getVectorForRotation, getYOffset, handleWaterMovement, hasCustomName, hashCode, hasNoGravity, hitByEntity, ignoreItemEntityData, isAddedToWorld, isBeingRidden, isBurning, isCreatureType, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isGlowing, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isNonBoss, isOffsetPositionInLiquid, isOnSameTeam, isOnScoreboardTeam, isOutsideBorder, isOverWater, isPassenger, isPushedByWater, isRiding, isRidingOrBeingRiddenBy, isRidingSameEntity, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, makeFlySound, move, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onAddedToWorld, onCollideWithPlayer, onInsideBlock, onKillEntity, onRemovedFromWorld, onStruckByLightning, playFlySound, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, rayTrace, readFromNBT, registerFixes, removePassenger, removePassengers, removeTag, removeTrackingPlayer, resetEntityId, resetPositionToBB, sendCommandFeedback, sendMessage, serializeNBT, setAir, setAlwaysRenderNameTag, setCommandStat, setCommandStats, setCustomNameTag, setDead, setDropItemsWhenDead, setEntityBoundingBox, setEntityId, setEntityInvulnerable, setFire, setFlag, setGlowing, setInvisible, setInWeb, setLocationAndAngles, setNoGravity, setOnFireFromLava, setOutsideBorder, setPortal, setPosition, setPositionAndRotation, setPositionAndUpdate, setPositionNonDirty, setRenderDistanceWeight, setRotation, setSilent, setSize, setSneaking, setUniqueId, setVelocity, setWorld, shouldDismountInWater, shouldRenderInPass, shouldRiderSit, shouldSetPosAfterLoading, spawnRunningParticles, startRiding, toString, turn, updatePassenger, writeToNBT, writeToNBTAtomically, writeToNBTOptionalpublic int livingSoundTime
protected int experienceValue
protected EntityMoveHelper moveHelper
protected EntityJumpHelper jumpHelper
protected PathNavigate navigator
public final EntityAITasks tasks
targetTasks, etc.)public final EntityAITasks targetTasks
protected float[] inventoryHandsDropChances
protected float[] inventoryArmorDropChances
public EntityLiving(World worldIn)
protected void initEntityAI()
protected void applyEntityAttributes()
applyEntityAttributes in class EntityLivingBaseprotected PathNavigate createNavigator(World worldIn)
public float getPathPriority(PathNodeType nodeType)
public void setPathPriority(PathNodeType nodeType, float priority)
protected EntityBodyHelper createBodyHelper()
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 void playHurtSound(DamageSource source)
playHurtSound 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 updateDistance(float p_110146_1_,
float p_110146_2_)
updateDistance in class EntityLivingBaseprotected SoundEvent getAmbientSound()
protected Item getDropItem()
protected void dropFewItems(boolean wasRecentlyHit,
int lootingModifier)
dropFewItems in class EntityLivingBasepublic static void registerFixesMob(DataFixer fixer, java.lang.Class<?> name)
public void writeEntityToNBT(NBTTagCompound compound)
writeEntityToNBT in class EntityLivingBasepublic void readEntityFromNBT(NBTTagCompound compound)
readEntityFromNBT in class EntityLivingBaseprotected ResourceLocation getLootTable()
protected void dropLoot(boolean wasRecentlyHit,
int lootingModifier,
DamageSource source)
dropLoot in class EntityLivingBasepublic void setMoveForward(float amount)
public void setMoveVertical(float amount)
public void setMoveStrafing(float amount)
public void setAIMoveSpeed(float speedIn)
setAIMoveSpeed in class EntityLivingBasepublic void onLivingUpdate()
onLivingUpdate in class EntityLivingBaseprotected void updateEquipmentIfNeeded(EntityItem itemEntity)
protected boolean canEquipItem(ItemStack stack)
protected boolean canDespawn()
protected void despawnEntity()
protected final void updateEntityActionState()
updateEntityActionState in class EntityLivingBaseprotected void updateAITasks()
public int getVerticalFaceSpeed()
public int getHorizontalFaceSpeed()
public void faceEntity(Entity entityIn, float maxYawIncrease, float maxPitchIncrease)
public boolean getCanSpawnHere()
public boolean isNotColliding()
public float getRenderSizeModifier()
public int getMaxSpawnedInChunk()
public int getMaxFallHeight()
getMaxFallHeight in class Entitypublic java.lang.Iterable<ItemStack> getHeldEquipment()
getHeldEquipment in class Entitypublic java.lang.Iterable<ItemStack> getArmorInventoryList()
getArmorInventoryList in class EntityLivingBasepublic ItemStack getItemStackFromSlot(EntityEquipmentSlot slotIn)
getItemStackFromSlot in class EntityLivingBasepublic void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack)
setItemStackToSlot in class EntityLivingBaseprotected void dropEquipment(boolean wasRecentlyHit,
int lootingModifier)
dropEquipment in class EntityLivingBaseprotected void setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
public static EntityEquipmentSlot getSlotForItemStack(ItemStack stack)
public static Item getArmorByChance(EntityEquipmentSlot slotIn, int chance)
protected void setEnchantmentBasedOnDifficulty(DifficultyInstance difficulty)
public IEntityLivingData onInitialSpawn(DifficultyInstance difficulty, IEntityLivingData livingdata)
public boolean canBeSteered()
public void enablePersistence()
public void setDropChance(EntityEquipmentSlot slotIn, float chance)
public boolean canPickUpLoot()
public void setCanPickUpLoot(boolean canPickup)
public boolean isNoDespawnRequired()
public final boolean processInitialInteract(EntityPlayer player, EnumHand hand)
processInitialInteract in class Entityprotected boolean processInteract(EntityPlayer player, EnumHand hand)
protected void updateLeashedState()
public void clearLeashed(boolean sendPacket,
boolean dropLead)
public boolean canBeLeashedTo(EntityPlayer player)
public boolean getLeashed()
public Entity getLeashHolder()
public void setLeashHolder(Entity entityIn, boolean sendAttachNotification)
public boolean startRiding(Entity entityIn, boolean force)
startRiding in class Entitypublic boolean replaceItemInInventory(int inventorySlot,
ItemStack itemStackIn)
replaceItemInInventory in class Entitypublic boolean canPassengerSteer()
canPassengerSteer in class Entitypublic static boolean isItemStackInSlot(EntityEquipmentSlot slotIn, ItemStack stack)
public boolean isServerWorld()
isServerWorld in class EntityLivingBasepublic void setNoAI(boolean disable)
public void setLeftHanded(boolean leftHanded)
public boolean isAIDisabled()
public boolean isLeftHanded()
public EnumHandSide getPrimaryHand()
getPrimaryHand in class EntityLivingBase