Package net.minecraft.src
Class Entity
java.lang.Object
net.minecraft.src.Entity
- Direct Known Subclasses:
BlockLiftedByPlatformEntity,CanvasEntity,CorpseEyeEntity,DynamiteEntity,EntityArrow,EntityBoat,EntityDragonPart,EntityEnderCrystal,EntityEnderEye,EntityFallingSand,EntityFireball,EntityFireworkRocket,EntityFishHook,EntityFX,EntityHanging,EntityItem,EntityLivingBase,EntityMinecart,EntityThrowable,EntityTNTPrimed,EntityWeatherEffect,EntityXPOrb,MechanicalPowerSourceEntity,MiningChargeEntity,MovingAnchorEntity,MovingPlatformEntity,SoulSandEntity
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanHas this entity been added to the chunk its withinfinal AxisAlignedBBAxis aligned bounding box.intintintprotected DataWatcherintWhich dimension the player is in (-1 = the Nether, 0 = normal world)floatThe distance walked multiplied by 0.6floatfloatReduces the velocity applied by entity collisions by the specified percent.intfloatbooleanintThe amount of ticks you have to stand inside of fire before be set on firebooleanfloatHow high this entity is considered to beintRemaining time an entity will be "immune" to further damage after being hurt.booleanRender entity even if it is outside the camera frustum.protected booleanWhether the entity is inside a PortalbooleanWhether this entity is currently inside of water (if it handles water movement that is)booleanbooleanTrue if after a move this entity has collided with something either vertically or horizontallybooleanTrue if after a move this entity has collided with something on X- or Z-axisbooleanTrue if after a move this entity has collided with something on Y-axisbooleanGets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term)protected booleanprotected booleanprotected intprotected intprotected intdoubleThe entity's X coordinate at the previous tick, used to calculate position during rendering routinesdoubleThe entity's Y coordinate at the previous tick, used to calculate position during rendering routinesdoubleThe entity's Z coordinate at the previous tick, used to calculate position during rendering routinesdoubleEntity motion XdoubleEntity motion YdoubleEntity motion Zprotected floatbooleanWhether this entity won't clip with collision or not (make note it won't disable gravity)booleanprotected intdoubleEntity position XdoubleEntity position YdoubleEntity position ZfloatThe previous ticks distance walked multiplied by 0.6booleanBlocks entities from spawning when they do their AABB check to make sure the spot is clear of entities that can prevent spawning.doubledoubledoublefloatfloatdoubleThe entity that is riding this entityThe entity we are currently ridingfloatEntity rotation PitchfloatEntity rotation YawintintintfloatHow high this entity can step up when running into a block to try to get over it (currently make note the entity will always step up this amount and not just the amount needed)protected intintHow many ticks has this entity had ran since being aliveintbooleanfloatHow wide this entity is considered to beReference to the World object.floatfloatFCNOTE: TERRIBLE NAMING. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddComponent(EntityComponent component) voidaddEntityCrashInfo(CrashReportCategory par1CrashReportCategory) voidaddToPlayerScore(Entity par1Entity, int par2) Adds a value to the player score.voidaddVelocity(double par1, double par3, double par5) Adds to the current velocity of the entity.booleanvoidapplyEntityCollision(Entity par1Entity) Applies a velocity to each of the entities pushing them away from each other.booleanattackEntityFrom(DamageSource par1DamageSource, float par2) Called when the entity is attacked.booleanbooleanIf returns false, the item will not inflict any damage against entities.booleanReturns true if other Entities should be prevented from moving through this Entity.booleanReturns true if this entity should push and be pushed by other entities when colliding.booleancanCollideWithEntity(Entity entity) booleanbooleanReturn whether this entity should be rendered as on fire.protected booleanreturns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to prevent them from trampling cropsvoidcopyDataFrom(Entity par1Entity, boolean par2) Copies important data from another entity to this entity.voidcopyLocationAndAnglesFrom(Entity par1Entity) Sets this entity's location and angles to the location and angles of the passed in entity.voiddealFireDamage(int par1) Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage.protected void// +++START EDIT+++ // ---END EDIT--- Checks for block collisions, and calls the associated onBlockCollided method for the collided block.booleanbooleanbooleanReturn whether this entity should NOT trigger a pressure plate or a tripwire.booleandropItem(int par1, int par2) Drops an item stack at the entity's position.dropItemWithOffset(int par1, int par2, float par3) Drops an item stack with a specified y offset.entityDropItem(ItemStack par1ItemStack, float par2) Drops an item at the position of the entity.protected abstract voidbooleanvoidRemoves fire from entity.protected voidfall(float par1) Called when the mob is falling.voidvoidflingAwayFromEntity(Entity repulsingEntity, double dForceMultiplier) intgetAir()protected doublefloatgetBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) Gets a block's resistance to this entity's explosion.returns the bounding box for this entityfloatgetBrightness(float par1) Gets how bright this entity is.intgetBrightnessForRender(float par1) booleangetCanBeHeadCrabbed(boolean bSquidInWater) floatgetCollisionBox(Entity par1Entity) Returns a boundingBox used to collide the entity with other entities and blocks.<C extends EntityComponent>
Optional<C>getComponent(Class<C> componentClass) doublegetDistance(double par1, double par3, double par5) Gets the distance to the position.doublegetDistanceSq(double par1, double par3, double par5) Gets the squared distance to the position.doublegetDistanceSqToEntity(Entity par1Entity) Returns the squared distance to the entity.floatgetDistanceToEntity(Entity par1Entity) Returns the distance to the entity.Gets the username of the entity.protected final String// +++START EDIT+++ // ---END EDIT--- Returns the string that identifies this Entity's classfloatprotected booleangetFlag(int par1) Returns true if the flag is active for the entity.returns a (normalized) vector of where this entity is lookingintReturn the amount of time this entity should stay in a portal before being transported.intThe number of iterations PathFinder.getSafePoint will execute before giving up.doubleReturns the Y offset from the entity's position for any entity riding this one.Entity[]getParts()Return the Entity parts making up this Entity (currently only for dragons)intReturn the amount of cooldown before this entity can use a portal again.floatfloatintReturns the translated name of the entity.doublegetXZDistanceSqToEntity(Entity par1Entity) Returns the squared distance to the entity.doubleReturns the Y Offset of this entity.voidhandleHealthUpdate(byte par1) booleanWhether or not the current entity is in lavabooleanReturns if this entity is in water and will end up adding the waters velocity to the entitybooleanhasComponent(Class<? extends EntityComponent> componentClass) inthashCode()booleanbooleanhitByEntity(Entity par1Entity) Called when a player attacks an entity.voidbooleaninteractFirst(EntityPlayer par1EntityPlayer) First layer of player interactionbooleanbooleanbooleanReturns true if the entity is on fire.booleanisEating()booleanChecks whether target entity is alive.booleanisEntityEqual(Entity par1Entity) Returns true if Entity argument is equal to this EntitybooleanChecks if this entity is inside of an opaque blockbooleanisEntityInsideOpaqueBlock(boolean checkFeet) booleanbooleanisEntityInsideSuffocatingBlock(boolean checkFeet) booleanReturn whether this entity is invulnerable to damage.final booleanbooleanbooleanisInRangeToRenderDist(double par1) Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length * 64 * renderDistanceWeight Args: distancebooleanisInRangeToRenderVec3D(Vec3 par1Vec3) Checks using a Vec3d to determine if this entity is within range of that vector to be rendered.booleanisInsideOfMaterial(Material par1Material) Checks if the current block the entity is within of the specified material typebooleanbooleanisInvisibleToPlayer(EntityPlayer par1EntityPlayer) Only used by renderer in EntityLivingBase subclasses.booleanChecks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true)booleanbooleanisOffsetPositionInLiquid(double par1, double par3, double par5) Checks if the offset position from the entity's current position is inside of liquid.booleanbooleanisRiding()Returns true if the entity is riding another entity, used by render to rotate the legs to be in 'sit' position for players.booleanbooleanReturns if this entity is sneaking.booleanGet if the Entity is sprinting.booleanbooleanbooleanbooleanisWet()Checks if this entity is either in water or on an open air block in rain (used in wolves).protected voidkill()sets the dead flag.voidmountEntity(Entity par1Entity) Called when a player mounts an entity. e.g. mounts a pig, mounts a boat.voidmountEntityRemote(Entity entityToMount) Called when clients receive a packed from the server indicating that they should mount an entity as part of fix for MC-1291.voidmoveEntity(double dMoveX, double dMoveY, double dMoveZ) voidmoveFlying(float par1, float par2, float par3) Used in both water and by flying objectsdoubleprotected NBTTagListnewDoubleNBTList(double... par1ArrayOfDouble) creates a NBT list from the array of doubles passed to this functionprotected NBTTagListnewFloatNBTList(float... par1ArrayOfFloat) Returns a new NBTTagList filled with the specified floatsvoidnotifyOfWolfHowl(Entity sourceEntity) booleanonBlockDispenserConsume(BlockDispenserBlock blockDispenser, BlockDispenserTileEntity tileEentityDispenser) Called when block dispenser tries to eat this entity, return true if the Dispenser should stop looking for more stuff to consumevoidvoidonCollideWithPlayer(EntityPlayer par1EntityPlayer) Called by a player entity when they collide with an entityvoidGets called every tick from main Entity classvoidvoidvoidonKickedByAnimal(KickingAnimal kickingAnimal) voidonKillEntity(EntityLivingBase par1EntityLivingBase) This method gets called when the entity kills another one.booleanonPossessedRidingEntityDeath(PossessionSource<?> source) Returns true if this function has handled the possession transfer from the dead entity.voidonStruckByLightning(EntityLightningBolt boltEntity) Called when a lightning bolt hits the entity.voidonUpdate()Called to update the entity's position/logic.voidvoidSetups the entity to do the hurt animation.voidprotected voidplayStepSound(int par1, int par2, int par3, int par4) Plays step sound at given x, y, z for the entityprotected voidKeeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned (only actually used on players though its also on Entity)protected booleanpushOutOfBlocks(double par1, double par3, double par5) Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, zprotected abstract void(abstract) Protected helper method to read subclass entity data from NBT.voidvoidsetAir(int par1) voidsetAngles(float par1, float par2) Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch.voidSets that this entity has been attacked.voidsetCurrentItemOrArmor(int par1, ItemStack par2ItemStack) Sets the held item, or an armor slot.voidsetDead()Will get destroyed next tick.voidsetEating(boolean par1) voidsetFire(int par1) Sets entity to burn for x amount of seconds, cannot lower amount of existing fire.protected voidsetFlag(int par1, boolean par2) Enable or disable a entity flag, see getEntityFlag to read the know flags.voidCalled by portal blocks when an entity is within it.voidsetInvisible(boolean par1) voidsetInWeb()Sets the Entity inside a web block.voidsetLocationAndAngles(double par1, double par3, double par5, float par7, float par8) Sets the location and Yaw/Pitch of an entity in the worldprotected voidCalled whenever the entity is walking inside of lava.voidsetPosition(double par1, double par3, double par5) Sets the x,y,z of the entity from the given parameters.voidsetPositionAndRotation(double par1, double par3, double par5, float par7, float par8) Sets the entity's position and rotation.voidsetPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) Sets the position and rotation.protected voidsetRotation(float par1, float par2) Sets the rotation of the entityvoidsetRotationYawHead(float par1) Sets the head's yaw rotation of the entity.protected voidsetSize(float par1, float par2) Sets the width and height of the entity.voidsetSneaking(boolean par1) Sets the sneaking flag.voidsetSprinting(boolean par1) Set sprinting switch for Entity.voidsetVelocity(double par1, double par3, double par5) Sets the velocity to the args.voidSets the reference to the World object.booleanshouldExplodeBlock(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7) protected booleanprotected booleantoString()voidtravelToDimension(int par1) Teleports the entity to another dimension.voidvoidprotected voidupdateFallState(double par1, boolean par3) Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and deal fall damage if landing on the ground.voidHandles updating while being ridden by an entityvoidprotected abstract void(abstract) Protected helper method to write subclass entity data to NBT.booleanwriteMountToNBT(NBTTagCompound par1NBTTagCompound) Like writeToNBTOptional but does not check if the entity is ridden.voidwriteToNBT(NBTTagCompound par1NBTTagCompound) Save the entity to NBT (calls an abstract helper method to write extra data)booleanwriteToNBTOptional(NBTTagCompound par1NBTTagCompound) Either write this entity to the NBT tag given and return true, or return false without doing anything.
-
Field Details
-
entityId
public int entityId -
renderDistanceWeight
public double renderDistanceWeight -
preventEntitySpawning
public boolean preventEntitySpawningBlocks entities from spawning when they do their AABB check to make sure the spot is clear of entities that can prevent spawning. -
riddenByEntity
The entity that is riding this entity -
ridingEntity
The entity we are currently riding -
forceSpawn
public boolean forceSpawn -
worldObj
Reference to the World object. -
prevPosX
public double prevPosX -
prevPosY
public double prevPosY -
prevPosZ
public double prevPosZ -
posX
public double posXEntity position X -
posY
public double posYEntity position Y -
posZ
public double posZEntity position Z -
motionX
public double motionXEntity motion X -
motionY
public double motionYEntity motion Y -
motionZ
public double motionZEntity motion Z -
rotationYaw
public float rotationYawEntity rotation Yaw -
rotationPitch
public float rotationPitchEntity rotation Pitch -
prevRotationYaw
public float prevRotationYaw -
prevRotationPitch
public float prevRotationPitch -
boundingBox
Axis aligned bounding box. -
onGround
public boolean onGround -
isCollidedHorizontally
public boolean isCollidedHorizontallyTrue if after a move this entity has collided with something on X- or Z-axis -
isCollidedVertically
public boolean isCollidedVerticallyTrue if after a move this entity has collided with something on Y-axis -
isCollided
public boolean isCollidedTrue if after a move this entity has collided with something either vertically or horizontally -
velocityChanged
public boolean velocityChanged -
isInWeb
protected boolean isInWeb -
field_70135_K
public boolean field_70135_K -
isDead
public boolean isDeadGets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term) -
yOffset
public float yOffset -
width
public float widthHow wide this entity is considered to be -
height
public float heightHow high this entity is considered to be -
prevDistanceWalkedModified
public float prevDistanceWalkedModifiedThe previous ticks distance walked multiplied by 0.6 -
distanceWalkedModified
public float distanceWalkedModifiedThe distance walked multiplied by 0.6 -
distanceWalkedOnStepModified
public float distanceWalkedOnStepModified -
fallDistance
public float fallDistance -
nextBlockCheckDistance
protected float nextBlockCheckDistance -
lastGroundPosX
protected int lastGroundPosX -
lastGroundPosY
protected int lastGroundPosY -
lastGroundPosZ
protected int lastGroundPosZ -
lastTickPosX
public double lastTickPosXThe entity's X coordinate at the previous tick, used to calculate position during rendering routines -
lastTickPosY
public double lastTickPosYThe entity's Y coordinate at the previous tick, used to calculate position during rendering routines -
lastTickPosZ
public double lastTickPosZThe entity's Z coordinate at the previous tick, used to calculate position during rendering routines -
ySize
public float ySizeFCNOTE: TERRIBLE NAMING. This is actually the position offset due to player sneaking/crouching -
stepHeight
public float stepHeightHow high this entity can step up when running into a block to try to get over it (currently make note the entity will always step up this amount and not just the amount needed) -
noClip
public boolean noClipWhether this entity won't clip with collision or not (make note it won't disable gravity) -
entityCollisionReduction
public float entityCollisionReductionReduces the velocity applied by entity collisions by the specified percent. -
rand
-
ticksExisted
public int ticksExistedHow many ticks has this entity had ran since being alive -
fireResistance
public int fireResistanceThe amount of ticks you have to stand inside of fire before be set on fire -
inWater
public boolean inWaterWhether this entity is currently inside of water (if it handles water movement that is) -
hurtResistantTime
public int hurtResistantTimeRemaining time an entity will be "immune" to further damage after being hurt. -
isImmuneToFire
protected boolean isImmuneToFire -
dataWatcher
-
addedToChunk
public boolean addedToChunkHas this entity been added to the chunk its within -
chunkCoordX
public int chunkCoordX -
chunkCoordY
public int chunkCoordY -
chunkCoordZ
public int chunkCoordZ -
serverPosX
public int serverPosX -
serverPosY
public int serverPosY -
serverPosZ
public int serverPosZ -
ignoreFrustumCheck
public boolean ignoreFrustumCheckRender entity even if it is outside the camera frustum. Only true in EntityFish for now. Used in RenderGlobal: render if ignoreFrustumCheck or in frustum. -
isAirBorne
public boolean isAirBorne -
timeUntilPortal
public int timeUntilPortal -
inPortal
protected boolean inPortalWhether the entity is inside a Portal -
portalCounter
protected int portalCounter -
dimension
public int dimensionWhich dimension the player is in (-1 = the Nether, 0 = normal world) -
teleportDirection
protected int teleportDirection -
myEntitySize
-
-
Constructor Details
-
Entity
-
-
Method Details
-
entityInit
protected abstract void entityInit() -
getDataWatcher
-
equals
-
hashCode
public int hashCode() -
preparePlayerToSpawn
protected void preparePlayerToSpawn()Keeps moving the entity up so it isn't colliding with blocks and other requirements for this entity to be spawned (only actually used on players though its also on Entity) -
setDead
public void setDead()Will get destroyed next tick. -
setSize
protected void setSize(float par1, float par2) Sets the width and height of the entity. Args: width, height -
setRotation
protected void setRotation(float par1, float par2) Sets the rotation of the entity -
setPosition
public void setPosition(double par1, double par3, double par5) Sets the x,y,z of the entity from the given parameters. Also seems to set up a bounding box. -
setAngles
public void setAngles(float par1, float par2) Adds par1*0.15 to the entity's yaw, and *subtracts* par2*0.15 from the pitch. Clamps pitch from -90 to 90. Both arguments in degrees. -
onUpdate
public void onUpdate()Called to update the entity's position/logic. -
onEntityUpdate
public void onEntityUpdate()Gets called every tick from main Entity class -
getMaxInPortalTime
public int getMaxInPortalTime()Return the amount of time this entity should stay in a portal before being transported. -
setOnFireFromLava
protected void setOnFireFromLava()Called whenever the entity is walking inside of lava. -
setFire
public void setFire(int par1) Sets entity to burn for x amount of seconds, cannot lower amount of existing fire. -
extinguish
public void extinguish()Removes fire from entity. -
kill
protected void kill()sets the dead flag. Used when you fall off the bottom of the world. -
isOffsetPositionInLiquid
public boolean isOffsetPositionInLiquid(double par1, double par3, double par5) Checks if the offset position from the entity's current position is inside of liquid. Args: x, y, z -
tryToSetFireToBlocksInContact
public void tryToSetFireToBlocksInContact() -
doBlockCollisions
protected void doBlockCollisions()// +++START EDIT+++ // ---END EDIT--- Checks for block collisions, and calls the associated onBlockCollided method for the collided block. -
playStepSound
protected void playStepSound(int par1, int par2, int par3, int par4) Plays step sound at given x, y, z for the entity -
playSound
-
canTriggerWalking
protected boolean canTriggerWalking()returns if this entity triggers Block.onEntityWalking on the blocks they walk on. used for spiders and wolves to prevent them from trampling crops -
updateFallState
protected void updateFallState(double par1, boolean par3) Takes in the distance the entity has fallen this tick and whether its on the ground to update the fall distance and deal fall damage if landing on the ground. Args: distanceFallenThisTick, onGround -
getBoundingBox
returns the bounding box for this entity -
dealFireDamage
public void dealFireDamage(int par1) Will deal the specified amount of damage to the entity if the entity isn't immune to fire damage. Args: amountDamage -
isImmuneToFire
public final boolean isImmuneToFire() -
fall
protected void fall(float par1) Called when the mob is falling. Calculates and applies fall damage. -
isWet
public boolean isWet()Checks if this entity is either in water or on an open air block in rain (used in wolves). -
isInWater
public boolean isInWater()Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning true) -
handleWaterMovement
public boolean handleWaterMovement()Returns if this entity is in water and will end up adding the waters velocity to the entity -
isInsideOfMaterial
Checks if the current block the entity is within of the specified material type -
getEyeHeight
public float getEyeHeight() -
handleLavaMovement
public boolean handleLavaMovement()Whether or not the current entity is in lava -
moveFlying
public void moveFlying(float par1, float par2, float par3) Used in both water and by flying objects -
getBrightnessForRender
public int getBrightnessForRender(float par1) -
getBrightness
public float getBrightness(float par1) Gets how bright this entity is. -
setWorld
Sets the reference to the World object. -
setPositionAndRotation
public void setPositionAndRotation(double par1, double par3, double par5, float par7, float par8) Sets the entity's position and rotation. Args: posX, posY, posZ, yaw, pitch -
setLocationAndAngles
public void setLocationAndAngles(double par1, double par3, double par5, float par7, float par8) Sets the location and Yaw/Pitch of an entity in the world -
getDistanceToEntity
Returns the distance to the entity. Args: entity -
getDistanceSq
public double getDistanceSq(double par1, double par3, double par5) Gets the squared distance to the position. Args: x, y, z -
getDistance
public double getDistance(double par1, double par3, double par5) Gets the distance to the position. Args: x, y, z -
getDistanceSqToEntity
Returns the squared distance to the entity. Args: entity -
getXZDistanceSqToEntity
Returns the squared distance to the entity. Args: entity -
onCollideWithPlayer
Called by a player entity when they collide with an entity -
applyEntityCollision
Applies a velocity to each of the entities pushing them away from each other. Args: entity -
addVelocity
public void addVelocity(double par1, double par3, double par5) Adds to the current velocity of the entity. Args: x, y, z -
setBeenAttacked
public void setBeenAttacked()Sets that this entity has been attacked. -
attackEntityFrom
Called when the entity is attacked. -
canBeCollidedWith
public boolean canBeCollidedWith()Returns true if other Entities should be prevented from moving through this Entity. -
canBePushed
public boolean canBePushed()Returns true if this entity should push and be pushed by other entities when colliding. -
addToPlayerScore
Adds a value to the player score. Currently not actually used and the entity passed in does nothing. Args: entity, scoreToAdd -
writeMountToNBT
Like writeToNBTOptional but does not check if the entity is ridden. Used for saving ridden entities with their riders. -
writeToNBTOptional
Either write this entity to the NBT tag given and return true, or return false without doing anything. If this returns false the entity is not saved on disk. Ridden entities return false here as they are saved with their rider. -
isInRangeToRenderVec3D
Checks using a Vec3d to determine if this entity is within range of that vector to be rendered. Args: vec3D -
isInRangeToRenderDist
public boolean isInRangeToRenderDist(double par1) Checks if the entity is in range to render by using the past in distance and comparing it to its average edge length * 64 * renderDistanceWeight Args: distance -
shouldSetPosAfterLoading
protected boolean shouldSetPosAfterLoading() -
writeToNBT
Save the entity to NBT (calls an abstract helper method to write extra data) -
getEntityString
// +++START EDIT+++ // ---END EDIT--- Returns the string that identifies this Entity's class -
onChunkLoad
public void onChunkLoad() -
outOfUpdateRangeUpdate
public void outOfUpdateRangeUpdate() -
readEntityFromNBT
(abstract) Protected helper method to read subclass entity data from NBT. -
writeEntityToNBT
(abstract) Protected helper method to write subclass entity data to NBT. -
newDoubleNBTList
creates a NBT list from the array of doubles passed to this function -
newFloatNBTList
Returns a new NBTTagList filled with the specified floats -
getShadowSize
public float getShadowSize() -
dropItem
Drops an item stack at the entity's position. Args: itemID, count -
dropItemWithOffset
Drops an item stack with a specified y offset. Args: itemID, count, yOffset -
entityDropItem
Drops an item at the position of the entity. -
interactFirst
First layer of player interaction -
isEntityAlive
public boolean isEntityAlive()Checks whether target entity is alive. -
isEntityInsideOpaqueBlock
public boolean isEntityInsideOpaqueBlock()Checks if this entity is inside of an opaque block -
isEntityInsideOpaqueBlock
public boolean isEntityInsideOpaqueBlock(boolean checkFeet) -
isEntityInsideSuffocatingBlock
public boolean isEntityInsideSuffocatingBlock() -
isEntityInsideSuffocatingBlock
public boolean isEntityInsideSuffocatingBlock(boolean checkFeet) -
getCollisionBox
Returns a boundingBox used to collide the entity with other entities and blocks. This enables the entity to be pushable on contact, like boats or minecarts. -
updateRidden
public void updateRidden()Handles updating while being ridden by an entity -
updateRiderPosition
public void updateRiderPosition() -
getYOffset
public double getYOffset()Returns the Y Offset of this entity. -
getMountedYOffset
public double getMountedYOffset()Returns the Y offset from the entity's position for any entity riding this one. -
mountEntity
Called when a player mounts an entity. e.g. mounts a pig, mounts a boat. -
setPositionAndRotation2
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9) Sets the position and rotation. Only difference from the other one is no bounding on the rotation. Args: posX, posY, posZ, yaw, pitch -
getCollisionBorderSize
public float getCollisionBorderSize() -
getLookVec
returns a (normalized) vector of where this entity is looking -
setInPortal
public void setInPortal()Called by portal blocks when an entity is within it. -
getPortalCooldown
public int getPortalCooldown()Return the amount of cooldown before this entity can use a portal again. -
setVelocity
public void setVelocity(double par1, double par3, double par5) Sets the velocity to the args. Args: x, y, z -
handleHealthUpdate
public void handleHealthUpdate(byte par1) -
performHurtAnimation
public void performHurtAnimation()Setups the entity to do the hurt animation. Only used by packets in multiplayer. -
updateCloak
public void updateCloak() -
getLastActiveItems
-
setCurrentItemOrArmor
Sets the held item, or an armor slot. Slot 0 is held item. Slot 1-4 is armor. Params: Item, slot -
isBurning
public boolean isBurning()Returns true if the entity is on fire. Used by render to add the fire effect on rendering. -
isRiding
public boolean isRiding()Returns true if the entity is riding another entity, used by render to rotate the legs to be in 'sit' position for players. -
isSneaking
public boolean isSneaking()Returns if this entity is sneaking. -
setSneaking
public void setSneaking(boolean par1) Sets the sneaking flag. -
isInvisibleToPlayer
Only used by renderer in EntityLivingBase subclasses.\nDetermines if an entity is visible or not to a specfic player, if the entity is normally invisible.\nFor EntityLivingBase subclasses, returning false when invisible will render the entity semitransparent. -
isUsingSpecialKey
public boolean isUsingSpecialKey() -
isSprinting
public boolean isSprinting()Get if the Entity is sprinting. -
setSprinting
public void setSprinting(boolean par1) Set sprinting switch for Entity. -
isInvisible
public boolean isInvisible() -
setInvisible
public void setInvisible(boolean par1) -
isEating
public boolean isEating() -
setEating
public void setEating(boolean par1) -
getFlag
protected boolean getFlag(int par1) Returns true if the flag is active for the entity. Known flags: 0) is burning; 1) is sneaking; 2) is riding something; 3) is sprinting; 4) is eating -
setFlag
protected void setFlag(int par1, boolean par2) Enable or disable a entity flag, see getEntityFlag to read the know flags. -
getAir
public int getAir() -
setAir
public void setAir(int par1) -
onStruckByLightning
Called when a lightning bolt hits the entity. -
onKillEntity
This method gets called when the entity kills another one. -
pushOutOfBlocks
protected boolean pushOutOfBlocks(double par1, double par3, double par5) Adds velocity to push the entity out of blocks at the specified x, y, z position Args: x, y, z -
setInWeb
public void setInWeb()Sets the Entity inside a web block. -
getEntityName
Gets the username of the entity. -
hitByEntity
Called when a player attacks an entity. If this returns true the attack will not happen. -
getParts
Return the Entity parts making up this Entity (currently only for dragons) -
isEntityEqual
Returns true if Entity argument is equal to this Entity -
copyLocationAndAnglesFrom
Sets this entity's location and angles to the location and angles of the passed in entity. -
getRotationYawHead
public float getRotationYawHead() -
setRotationYawHead
public void setRotationYawHead(float par1) Sets the head's yaw rotation of the entity. -
canAttackWithItem
public boolean canAttackWithItem()If returns false, the item will not inflict any damage against entities. -
getBlockExplosionResistance
public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block) Gets a block's resistance to this entity's explosion. Used to make rails immune to TNT minecarts' explosions and Wither skulls more destructive. -
getMaxSafePointTries
public int getMaxSafePointTries()The number of iterations PathFinder.getSafePoint will execute before giving up. -
toString
-
isEntityInvulnerable
public boolean isEntityInvulnerable()Return whether this entity is invulnerable to damage. -
copyDataFrom
Copies important data from another entity to this entity. Used when teleporting entities between worlds, as this actually deletes the teleporting entity and re-creates it on the other side. Params: Entity to copy from, unused (always true) -
travelToDimension
public void travelToDimension(int par1) Teleports the entity to another dimension. Params: Dimension number to teleport to -
shouldExplodeBlock
-
getTeleportDirection
public int getTeleportDirection() -
doesEntityNotTriggerPressurePlate
public boolean doesEntityNotTriggerPressurePlate()Return whether this entity should NOT trigger a pressure plate or a tripwire. -
addEntityCrashInfo
-
canRenderOnFire
public boolean canRenderOnFire()Return whether this entity should be rendered as on fire. -
isPushedByWater
public boolean isPushedByWater() -
getTranslatedEntityName
Returns the translated name of the entity. -
isAffectedByMovementModifiers
public boolean isAffectedByMovementModifiers() -
notifyOfWolfHowl
-
shouldSetPositionOnLoad
protected boolean shouldSetPositionOnLoad() -
canCollideWithEntity
-
isItemEntity
public boolean isItemEntity() -
canEntityTriggerTripwire
public boolean canEntityTriggerTripwire() -
getVisualBoundingBox
-
isSecondaryTargetForSquid
public boolean isSecondaryTargetForSquid() -
getCanBeHeadCrabbed
public boolean getCanBeHeadCrabbed(boolean bSquidInWater) -
isValidOngoingAttackTargetForSquid
public boolean isValidOngoingAttackTargetForSquid() -
onFlungBySquidTentacle
-
onHeadCrabbedBySquid
-
hasHeadCrabbedSquid
public boolean hasHeadCrabbedSquid() -
isImmuneToHeadCrabDamage
public boolean isImmuneToHeadCrabDamage() -
onKickedByAnimal
-
getAnimalKickMovementMultiplier
protected double getAnimalKickMovementMultiplier() -
flingAwayFromEntity
-
doesEntityApplyToSpawnCap
public boolean doesEntityApplyToSpawnCap() -
getUniqueID
-
appliesConstantForceWhenRidingBoat
public boolean appliesConstantForceWhenRidingBoat() -
movementModifierWhenRidingBoat
public double movementModifierWhenRidingBoat() -
onPossessedRidingEntityDeath
Returns true if this function has handled the possession transfer from the dead entity. Called on server only. -
isBeingRainedOn
public boolean isBeingRainedOn() -
doesEntityApplyToSquidPossessionCap
public boolean doesEntityApplyToSquidPossessionCap() -
isValidZombieSecondaryTarget
-
attractsLightning
public boolean attractsLightning() -
moveEntity
public void moveEntity(double dMoveX, double dMoveY, double dMoveZ) -
readFromNBT
-
mountEntityRemote
Called when clients receive a packed from the server indicating that they should mount an entity as part of fix for MC-1291. -
flagAllWatchedObjectsDirty
public void flagAllWatchedObjectsDirty() -
initComponents
public void initComponents() -
getComponent
-
addComponent
-
hasComponent
-
onBlockDispenserConsume
public boolean onBlockDispenserConsume(BlockDispenserBlock blockDispenser, BlockDispenserTileEntity tileEentityDispenser) Called when block dispenser tries to eat this entity, return true if the Dispenser should stop looking for more stuff to consume -
doesNotDismountInWater
public boolean doesNotDismountInWater()
-