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 class
EntityLiving.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 int
experienceValue
int
livingSoundTime
-
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 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 entitiesboolean
canPickUpLoot()
void
clearLeashed(boolean sendPacket, boolean dropLead)
+ Removes the leash from this entityprotected void
despawnEntity()
+ Makes the entity despawn if requirements are reachedprotected void
dropEquipment(boolean flag, int i)
+ Drop the equipment for this entity.protected void
dropFewItems(boolean var1, int i)
+ Drop 0-2 items of this living's typevoid
eatGrassBonus()
+ This function applies the benefits of growing back wool and faster growing up to the acting entity.void
enablePersistence()
+ Enable the Entity persistenceprotected void
entityInit()
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.protected float
func_110146_f(float var1, float f)
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 trackingboolean
getCanSpawnHere()
+ Checks if the entity's current position is a valid location to spawn this entity.ItemStack
getCurrentArmor(int i)
protected Item
getDropItem()
ItemStack
getEquipmentInSlot(int i)
+ 0: Tool in Hand; 1-4: Armorprotected int
getExperiencePoints(EntityPlayer var1)
+ 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)boolean
getLeashed()
Entity
getLeashedToEntity()
protected java.lang.String
getLivingSound()
+ Returns the sound this mob makes while it's alive.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.float
getRenderSizeModifier()
+ Returns render size modifierint
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 b0)
protected boolean
interact(EntityPlayer var1)
+ Called when a player interacts with a mob.boolean
interactFirst(EntityPlayer entityplayer)
+ First layer of player interactionboolean
isAIDisabled()
+ Get whether this Entity's AI is disabledboolean
isNoDespawnRequired()
boolean
isNotColliding()
+ Checks that the entity is not colliding with any blocks / liquidsboolean
isServerWorld()
+ Returns whether the entity is in a server worldvoid
onEntityUpdate()
+ Gets called every tick from main Entity classIEntityLivingData
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
playLivingSound()
+ Plays living's sound at its positionvoid
readEntityFromNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to read subclass entity data from NBT.boolean
replaceItemInInventory(int i, ItemStack itemstack)
void
setAIMoveSpeed(float f)
+ set the movespeed used for the new AI systemvoid
setAttackTarget(EntityLivingBase entitylivingbaseIn)
+ Sets the active target the Task system uses for trackingvoid
setCanPickUpLoot(boolean canPickup)
void
setCurrentItemOrArmor(int i, ItemStack itemstack)
+ Sets the held item, or an armor slot.protected void
setEnchantmentBasedOnDifficulty(DifficultyInstance difficulty)
+ Enchants Entity's current equipments based on given DifficultyInstanceprotected void
setEquipmentBasedOnDifficulty(DifficultyInstance difficulty)
+ Gives armor or weapon for entity based on given DifficultyInstancevoid
setEquipmentDropChance(int slotIn, float chance)
void
setLeashedToEntity(Entity entityIn, boolean sendAttachNotification)
+ Sets the entity to be leashed to.void
setMoveForward(float parFloat1)
void
setNoAI(boolean disable)
+ Set whether this Entity's AI is disabledvoid
spawnExplosionParticle()
+ Spawns an explosion particle around the Entity's locationprotected 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 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:
applyEntityAttributes
in 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:
entityInit
in 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:
onEntityUpdate
in classEntityLivingBase
-
getExperiencePoints
protected int getExperiencePoints(EntityPlayer var1)
+ Get the experience points the entity currently has.- Overrides:
getExperiencePoints
in classEntityLivingBase
-
spawnExplosionParticle
public void spawnExplosionParticle()
+ Spawns an explosion particle around the Entity's location
-
handleStatusUpdate
public void handleStatusUpdate(byte b0)
- Overrides:
handleStatusUpdate
in classEntityLivingBase
-
func_110146_f
protected float func_110146_f(float var1, float f)
- Overrides:
func_110146_f
in 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:
dropFewItems
in classEntityLivingBase
-
writeEntityToNBT
public void writeEntityToNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to write subclass entity data to NBT.- Overrides:
writeEntityToNBT
in classEntityLivingBase
-
readEntityFromNBT
public void readEntityFromNBT(NBTTagCompound nbttagcompound)
+ (abstract) Protected helper method to read subclass entity data from NBT.- Overrides:
readEntityFromNBT
in classEntityLivingBase
-
setMoveForward
public void setMoveForward(float parFloat1)
-
setAIMoveSpeed
public void setAIMoveSpeed(float f)
+ set the movespeed used for the new AI system- Overrides:
setAIMoveSpeed
in 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:
updateEntityActionState
in 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:
getMaxFallHeight
in classEntity
-
getHeldItem
public ItemStack getHeldItem()
+ Returns the item that this EntityLiving is holding, if any.- Specified by:
getHeldItem
in classEntityLivingBase
-
getEquipmentInSlot
public ItemStack getEquipmentInSlot(int i)
+ 0: Tool in Hand; 1-4: Armor- Specified by:
getEquipmentInSlot
in classEntityLivingBase
-
getCurrentArmor
public ItemStack getCurrentArmor(int i)
- Specified by:
getCurrentArmor
in 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:
setCurrentItemOrArmor
in classEntityLivingBase
-
getInventory
public ItemStack[] getInventory()
+ returns the inventory of this entity (only used in EntityPlayerMP it seems)- Specified by:
getInventory
in classEntityLivingBase
-
dropEquipment
protected void dropEquipment(boolean flag, int i)
+ Drop the equipment for this entity.- Overrides:
dropEquipment
in 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:
interactFirst
in 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:
replaceItemInInventory
in classEntity
-
isServerWorld
public boolean isServerWorld()
+ Returns whether the entity is in a server world- Overrides:
isServerWorld
in 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
-
-