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
Fighting tasks (used by monsters, wolves, ocelots)
|
EntityAITasks |
tasks
Passive tasks (wandering, look, idle, ...)
|
activeItemStack, activeItemStackUseCount, arrowHitTimer, attackedAtYaw, attackingPlayer, cameraPitch, dead, deathTime, entityAge, HAND_STATES, hurtTime, interpTargetPitch, interpTargetX, interpTargetY, interpTargetYaw, interpTargetZ, isJumping, isSwingInProgress, jumpMovementFactor, lastDamage, limbSwing, limbSwingAmount, maxHurtResistantTime, maxHurtTime, movedDistance, moveForward, moveStrafing, newPosRotationIncrements, onGroundSpeedFactor, prevCameraPitch, prevLimbSwingAmount, prevMovedDistance, prevOnGroundSpeedFactor, prevRenderYawOffset, prevRotationYawHead, prevSwingProgress, randomUnused1, randomUnused2, randomYawVelocity, recentlyHit, renderYawOffset, rotationYawHead, scoreValue, swingingHand, swingProgress, swingProgressInt, ticksElytraFlying, ticksSinceLastSwing, unused180
addedToChunk, cachedUniqueIdString, capturedDrops, captureDrops, chunkCoordX, chunkCoordY, chunkCoordZ, dataManager, dimension, distanceWalkedModified, distanceWalkedOnStepModified, entityCollisionReduction, entityUniqueID, fallDistance, firstUpdate, FLAGS, forceSpawn, glowing, height, hurtResistantTime, ignoreFrustumCheck, inPortal, inWater, isAirBorne, isCollided, isCollidedHorizontally, isCollidedVertically, 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 |
getLeashedToEntity() |
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 |
setLeashedToEntity(Entity entityIn,
boolean sendAttachNotification)
Sets the entity to be leashed to.
|
void |
setLeftHanded(boolean disable) |
void |
setMoveForward(float amount) |
void |
setMoveStrafing(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, getAge, getAIMoveSpeed, getAITarget, getAlwaysRenderNameTagForRender, getArrowCountInEntity, getAttackingEntity, getAttributeMap, getCapability, getCombatTracker, getCreatureAttribute, getDeathSound, getEntityAttribute, getFallSound, getHealth, getHeldItem, getHeldItemMainhand, getHeldItemOffhand, getHurtSound, getItemInUseCount, getItemInUseMaxCount, getJumpUpwardsMotion, getLastAttacker, getLastAttackerTime, getLastDamageSource, getLook, getLookVec, getMaxHealth, 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, kill, knockBack, markPotionsDirty, moveEntityWithHeading, notifyDataManagerChange, onChangedPotionEffect, onDeath, onDeathUpdate, onFinishedPotionEffect, onItemPickup, onItemUseFinish, onKillCommand, onNewPotionEffect, performHurtAnimation, playEquipSound, removeActivePotionEffect, removePotionEffect, renderBrokenItemStack, resetActiveHand, resetPotionEffectMetadata, sendEndCombat, sendEnterCombat, setAbsorptionAmount, setActiveHand, setArrowCountInEntity, setBeenAttacked, setHealth, setHeldItem, setJumping, setLastAttacker, setPositionAndRotationDirect, setRenderYawOffset, setRevengeTarget, setRotationYawHead, setSprinting, shouldRiderFaceForward, stopActiveHand, swingArm, updateActiveHand, updateArmSwingProgress, updateFallState, updateItemUse, updatePotionEffects, updatePotionMetadata, updateRidden
addEntityCrashInfo, addPassenger, addTag, addToPlayerScore, addTrackingPlayer, addVelocity, applyEnchantments, applyEntityCollision, applyOrientationToEntity, applyPlayerInteraction, canBeAttackedWithItem, canBeRidden, canFitPassenger, canRenderOnFire, canRiderInteract, canTrample, canTriggerWalking, canUseCommand, changeDimension, copyLocationAndAnglesFrom, createRunningParticles, dealFireDamage, decrementTimeUntilPortal, deserializeNBT, doBlockCollisions, doesEntityNotTriggerPressurePlate, dropItem, dropItemWithOffset, entityDropItem, equals, extinguish, getAdjustedHorizontalFacing, getAir, getAlwaysRenderNameTag, getBrightness, getBrightnessForRender, getCachedUniqueIdString, getCollisionBorderSize, getCollisionBoundingBox, getCollisionBox, getCommandSenderEntity, getCommandStats, getControllingPassenger, getCustomNameTag, getDataManager, getDisplayName, getDistance, getDistanceSq, getDistanceSq, getDistanceSqToCenter, getDistanceSqToEntity, getDistanceToEntity, getEntityBoundingBox, getEntityData, getEntityId, getEntityString, getEntityWorld, getEquipmentAndArmor, getExplosionResistance, getEyeHeight, getFireImmuneTicks, getFlag, getForward, getHorizontalFacing, getHoverEvent, getIsInvulnerable, getLastPortalVec, 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, isBeingRidden, isBurning, isCreatureType, isEntityEqual, isEntityInsideOpaqueBlock, isEntityInvulnerable, isGlowing, isImmuneToExplosions, isImmuneToFire, isInLava, isInRangeToRender3d, isInRangeToRenderDist, isInsideOfMaterial, isInvisible, isInvisibleToPlayer, isInWater, isNonBoss, isOffsetPositionInLiquid, isOnSameTeam, isOnScoreboardTeam, isOutsideBorder, isPassenger, isPushedByWater, isRiding, isRidingOrBeingRiddenBy, isRidingSameEntity, isSilent, isSneaking, isSpectatedByPlayer, isSprinting, isWet, move, moveRelative, moveToBlockPosAndAngles, newDoubleNBTList, newFloatNBTList, onCollideWithPlayer, onKillEntity, onStruckByLightning, playSound, playStepSound, preparePlayerToSpawn, pushOutOfBlocks, rayTrace, readFromNBT, registerFixes, removePassenger, removePassengers, removeTag, removeTrackingPlayer, resetEntityId, resetHeight, 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, verifyExplosion, writeToNBT, writeToNBTAtomically, writeToNBTOptional
public int livingSoundTime
protected int experienceValue
protected EntityMoveHelper moveHelper
protected EntityJumpHelper jumpHelper
protected PathNavigate navigator
public final EntityAITasks tasks
public final EntityAITasks targetTasks
protected float[] inventoryHandsDropChances
protected float[] inventoryArmorDropChances
public EntityLiving(World worldIn)
protected void initEntityAI()
protected void applyEntityAttributes()
applyEntityAttributes
in class EntityLivingBase
protected 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 EntityLivingBase
public int getTalkInterval()
public void playLivingSound()
public void onEntityUpdate()
onEntityUpdate
in class EntityLivingBase
protected void playHurtSound(DamageSource source)
playHurtSound
in class EntityLivingBase
protected int getExperiencePoints(EntityPlayer player)
getExperiencePoints
in class EntityLivingBase
public void spawnExplosionParticle()
public void handleStatusUpdate(byte id)
handleStatusUpdate
in class EntityLivingBase
public void onUpdate()
onUpdate
in class EntityLivingBase
protected float updateDistance(float p_110146_1_, float p_110146_2_)
updateDistance
in class EntityLivingBase
protected SoundEvent getAmbientSound()
protected Item getDropItem()
protected void dropFewItems(boolean wasRecentlyHit, int lootingModifier)
dropFewItems
in class EntityLivingBase
public static void registerFixesMob(DataFixer fixer, java.lang.Class<?> name)
public void writeEntityToNBT(NBTTagCompound compound)
writeEntityToNBT
in class EntityLivingBase
public void readEntityFromNBT(NBTTagCompound compound)
readEntityFromNBT
in class EntityLivingBase
protected ResourceLocation getLootTable()
protected void dropLoot(boolean wasRecentlyHit, int lootingModifier, DamageSource source)
dropLoot
in class EntityLivingBase
public void setMoveForward(float amount)
public void setMoveStrafing(float amount)
public void setAIMoveSpeed(float speedIn)
setAIMoveSpeed
in class EntityLivingBase
public void onLivingUpdate()
onLivingUpdate
in class EntityLivingBase
protected void updateEquipmentIfNeeded(EntityItem itemEntity)
protected boolean canEquipItem(ItemStack stack)
protected boolean canDespawn()
protected void despawnEntity()
protected final void updateEntityActionState()
updateEntityActionState
in class EntityLivingBase
protected 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 Entity
public java.lang.Iterable<ItemStack> getHeldEquipment()
getHeldEquipment
in class Entity
public java.lang.Iterable<ItemStack> getArmorInventoryList()
getArmorInventoryList
in class EntityLivingBase
public ItemStack getItemStackFromSlot(EntityEquipmentSlot slotIn)
getItemStackFromSlot
in class EntityLivingBase
public void setItemStackToSlot(EntityEquipmentSlot slotIn, ItemStack stack)
setItemStackToSlot
in class EntityLivingBase
protected void dropEquipment(boolean wasRecentlyHit, int lootingModifier)
dropEquipment
in class EntityLivingBase
protected 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 Entity
protected 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 getLeashedToEntity()
public void setLeashedToEntity(Entity entityIn, boolean sendAttachNotification)
public boolean startRiding(Entity entityIn, boolean force)
startRiding
in class Entity
public boolean replaceItemInInventory(int inventorySlot, ItemStack itemStackIn)
replaceItemInInventory
in class Entity
public boolean canPassengerSteer()
canPassengerSteer
in class Entity
public static boolean isItemStackInSlot(EntityEquipmentSlot slotIn, ItemStack stack)
public boolean isServerWorld()
isServerWorld
in class EntityLivingBase
public void setNoAI(boolean disable)
public void setLeftHanded(boolean disable)
public boolean isAIDisabled()
public boolean isLeftHanded()
public EnumHandSide getPrimaryHand()
getPrimaryHand
in class EntityLivingBase