public abstract class Entity extends Object
Modifier and Type | Field and Description |
---|---|
boolean |
addedToChunk
Has this entity been added to the chunk its within
|
AxisAlignedBB |
boundingBox
Axis aligned bounding box.
|
ArrayList<EntityItem> |
capturedDrops |
boolean |
captureDrops |
int |
chunkCoordX |
int |
chunkCoordY |
int |
chunkCoordZ |
int |
dimension
Which dimension the player is in (-1 = the Nether, 0 = normal world)
|
float |
distanceWalkedModified
The distance walked multiplied by 0.6
|
float |
distanceWalkedOnStepModified |
float |
entityCollisionReduction
Reduces the velocity applied by entity collisions by the specified percent.
|
int |
entityId |
float |
fallDistance |
boolean |
field_70135_K |
int |
fireResistance
The amount of ticks you have to stand inside of fire before be set on fire
|
boolean |
forceSpawn |
float |
height
How high this entity is considered to be
|
int |
hurtResistantTime
Remaining time an entity will be "immune" to further damage after being hurt.
|
boolean |
ignoreFrustumCheck
Render entity even if it is outside the camera frustum.
|
boolean |
isAirBorne |
boolean |
isCollided
True if after a move this entity has collided with something either vertically or horizontally
|
boolean |
isCollidedHorizontally
True if after a move this entity has collided with something on X- or Z-axis
|
boolean |
isCollidedVertically
True if after a move this entity has collided with something on Y-axis
|
boolean |
isDead
Gets set by setDead, so this must be the flag whether an Entity is dead (inactive may be better term)
|
double |
lastTickPosX
The entity's X coordinate at the previous tick, used to calculate position during rendering routines
|
double |
lastTickPosY
The entity's Y coordinate at the previous tick, used to calculate position during rendering routines
|
double |
lastTickPosZ
The entity's Z coordinate at the previous tick, used to calculate position during rendering routines
|
double |
motionX
Entity motion X
|
double |
motionY
Entity motion Y
|
double |
motionZ
Entity motion Z
|
EnumEntitySize |
myEntitySize |
boolean |
noClip
Whether this entity won't clip with collision or not (make note it won't disable gravity)
|
boolean |
onGround |
double |
posX
Entity position X
|
double |
posY
Entity position Y
|
double |
posZ
Entity position Z
|
float |
prevDistanceWalkedModified
The previous ticks distance walked multiplied by 0.6
|
boolean |
preventEntitySpawning
Blocks entities from spawning when they do their AABB check to make sure the spot is clear of entities that can
prevent spawning.
|
double |
prevPosX |
double |
prevPosY |
double |
prevPosZ |
float |
prevRotationPitch |
float |
prevRotationYaw |
double |
renderDistanceWeight |
Entity |
riddenByEntity
The entity that is riding this entity
|
Entity |
ridingEntity
The entity we are currently riding
|
float |
rotationPitch
Entity rotation Pitch
|
float |
rotationYaw
Entity rotation Yaw
|
int |
serverPosX |
int |
serverPosY |
int |
serverPosZ |
float |
stepHeight
How 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)
|
int |
ticksExisted
How many ticks has this entity had ran since being alive
|
int |
timeUntilPortal |
boolean |
velocityChanged |
float |
width
How wide this entity is considered to be
|
World |
worldObj
Reference to the World object.
|
float |
yOffset |
float |
ySize |
Modifier and Type | Method and Description |
---|---|
void |
addEntityCrashInfo(CrashReportCategory par1CrashReportCategory) |
void |
addToPlayerScore(Entity par1Entity,
int par2)
Adds a value to the player score.
|
void |
addVelocity(double par1,
double par3,
double par5)
Adds to the current velocity of the entity.
|
void |
applyEntityCollision(Entity par1Entity)
Applies a velocity to each of the entities pushing them away from each other.
|
boolean |
attackEntityFrom(DamageSource par1DamageSource,
float par2)
Called when the entity is attacked.
|
boolean |
canAttackWithItem()
If returns false, the item will not inflict any damage against entities.
|
boolean |
canBeCollidedWith()
Returns true if other Entities should be prevented from moving through this Entity.
|
boolean |
canBePushed()
Returns true if this entity should push and be pushed by other entities when colliding.
|
boolean |
canRenderOnFire() |
boolean |
canRiderInteract()
If a rider of this entity can interact with this entity.
|
void |
copyDataFrom(Entity par1Entity,
boolean par2)
Copies important data from another entity to this entity.
|
void |
copyLocationAndAnglesFrom(Entity par1Entity)
Sets this entity's location and angles to the location and angles of the passed in entity.
|
boolean |
doesEntityNotTriggerPressurePlate()
Return whether this entity should NOT trigger a pressure plate or a tripwire.
|
EntityItem |
dropItem(int par1,
int par2)
Drops an item stack at the entity's position.
|
EntityItem |
dropItemWithOffset(int par1,
int par2,
float par3)
Drops an item stack with a specified y offset.
|
EntityItem |
entityDropItem(ItemStack par1ItemStack,
float par2)
Drops an item at the position of the entity.
|
boolean |
equals(Object par1Obj) |
void |
extinguish()
Removes fire from entity.
|
int |
getAir() |
float |
getBlockExplosionResistance(Explosion par1Explosion,
World par2World,
int par3,
int par4,
int par5,
Block par6Block)
Gets a block's resistance to this entity's explosion.
|
AxisAlignedBB |
getBoundingBox()
returns the bounding box for this entity
|
float |
getBrightness(float par1)
Gets how bright this entity is.
|
int |
getBrightnessForRender(float par1) |
float |
getCollisionBorderSize() |
AxisAlignedBB |
getCollisionBox(Entity par1Entity)
Returns a boundingBox used to collide the entity with other entities and blocks.
|
DataWatcher |
getDataWatcher() |
double |
getDistance(double par1,
double par3,
double par5)
Gets the distance to the position.
|
double |
getDistanceSq(double par1,
double par3,
double par5)
Gets the squared distance to the position.
|
double |
getDistanceSqToEntity(Entity par1Entity)
Returns the squared distance to the entity.
|
float |
getDistanceToEntity(Entity par1Entity)
Returns the distance to the entity.
|
NBTTagCompound |
getEntityData()
Returns a NBTTagCompound that can be used to store custom data for this entity.
|
String |
getEntityName()
Gets the username of the entity.
|
IExtendedEntityProperties |
getExtendedProperties(String identifier)
Gets the extended properties identified by the passed in key
|
float |
getEyeHeight() |
ItemStack[] |
getLastActiveItems() |
Vec3 |
getLookVec()
returns a (normalized) vector of where this entity is looking
|
int |
getMaxInPortalTime()
Return the amount of time this entity should stay in a portal before being transported.
|
int |
getMaxSafePointTries()
The number of iterations PathFinder.getSafePoint will execute before giving up.
|
double |
getMountedYOffset()
Returns 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)
|
UUID |
getPersistentID() |
ItemStack |
getPickedResult(MovingObjectPosition target)
Called when a user uses the creative pick block button on this entity.
|
int |
getPortalCooldown()
Return the amount of cooldown before this entity can use a portal again.
|
float |
getRotationYawHead() |
float |
getShadowSize() |
int |
getTeleportDirection() |
String |
getTranslatedEntityName()
Returns the translated name of the entity.
|
UUID |
getUniqueID() |
double |
getYOffset()
Returns the Y Offset of this entity.
|
void |
handleHealthUpdate(byte par1) |
boolean |
handleLavaMovement()
Whether or not the current entity is in lava
|
boolean |
handleWaterMovement()
Returns if this entity is in water and will end up adding the waters velocity to the entity
|
int |
hashCode() |
boolean |
hitByEntity(Entity par1Entity)
Called when a player attacks an entity.
|
boolean |
interactFirst(EntityPlayer par1EntityPlayer)
First layer of player interaction
|
boolean |
isBurning()
Returns true if the entity is on fire.
|
boolean |
isCreatureType(EnumCreatureType type,
boolean forSpawnCount)
Returns true if the entity is of the @link{EnumCreatureType} provided
|
boolean |
isEating() |
boolean |
isEntityAlive()
Checks whether target entity is alive.
|
boolean |
isEntityEqual(Entity par1Entity)
Returns true if Entity argument is equal to this Entity
|
boolean |
isEntityInsideOpaqueBlock()
Checks if this entity is inside of an opaque block
|
boolean |
isEntityInvulnerable()
Return whether this entity is invulnerable to damage.
|
boolean |
isImmuneToFire() |
boolean |
isInRangeToRenderDist(double par1) |
boolean |
isInRangeToRenderVec3D(Vec3 par1Vec3) |
boolean |
isInsideOfMaterial(Material par1Material)
Checks if the current block the entity is within of the specified material type
|
boolean |
isInvisible() |
boolean |
isInvisibleToPlayer(EntityPlayer par1EntityPlayer) |
boolean |
isInWater()
Checks if this entity is inside water (if inWater field is true as a result of handleWaterMovement() returning
true)
|
boolean |
isOffsetPositionInLiquid(double par1,
double par3,
double par5)
Checks if the offset position from the entity's current position is inside of liquid.
|
boolean |
isPushedByWater() |
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.
|
boolean |
isSneaking()
Returns if this entity is sneaking.
|
boolean |
isSprinting()
Get if the Entity is sprinting.
|
boolean |
isWet()
Checks if this entity is either in water or on an open air block in rain (used in wolves).
|
void |
mountEntity(Entity par1Entity)
Called when a player mounts an entity.
|
void |
moveEntity(double par1,
double par3,
double par5)
Tries to moves the entity by the passed in displacement.
|
void |
moveFlying(float par1,
float par2,
float par3)
Used in both water and by flying objects
|
void |
onChunkLoad() |
void |
onCollideWithPlayer(EntityPlayer par1EntityPlayer)
Called by a player entity when they collide with an entity
|
void |
onEntityUpdate()
Gets called every tick from main Entity class
|
void |
onKillEntity(EntityLivingBase par1EntityLivingBase)
This method gets called when the entity kills another one.
|
void |
onStruckByLightning(EntityLightningBolt par1EntityLightningBolt)
Called when a lightning bolt hits the entity.
|
void |
onUpdate()
Called to update the entity's position/logic.
|
void |
performHurtAnimation() |
void |
playSound(String par1Str,
float par2,
float par3) |
void |
readFromNBT(NBTTagCompound par1NBTTagCompound)
Reads the entity from NBT (calls an abstract helper method to read specialized data)
|
String |
registerExtendedProperties(String identifier,
IExtendedEntityProperties properties)
Register the instance of IExtendedProperties into the entity's collection.
|
void |
resetEntityId()
Reset the entity ID to a new value.
|
void |
setAir(int par1) |
void |
setAngles(float par1,
float par2) |
void |
setCurrentItemOrArmor(int par1,
ItemStack par2ItemStack)
Sets the held item, or an armor slot.
|
void |
setDead()
Will get destroyed next tick.
|
void |
setEating(boolean par1) |
void |
setFire(int par1)
Sets entity to burn for x amount of seconds, cannot lower amount of existing fire.
|
void |
setInPortal()
Called by portal blocks when an entity is within it.
|
void |
setInvisible(boolean par1) |
void |
setInWeb()
Sets the Entity inside a web block.
|
void |
setLocationAndAngles(double par1,
double par3,
double par5,
float par7,
float par8)
Sets the location and Yaw/Pitch of an entity in the world
|
void |
setPosition(double par1,
double par3,
double par5)
Sets the x,y,z of the entity from the given parameters.
|
void |
setPositionAndRotation(double par1,
double par3,
double par5,
float par7,
float par8)
Sets the entity's position and rotation.
|
void |
setPositionAndRotation2(double par1,
double par3,
double par5,
float par7,
float par8,
int par9) |
void |
setRotationYawHead(float par1) |
void |
setSneaking(boolean par1)
Sets the sneaking flag.
|
void |
setSprinting(boolean par1)
Set sprinting switch for Entity.
|
void |
setVelocity(double par1,
double par3,
double par5) |
void |
setWorld(World par1World)
Sets the reference to the World object.
|
boolean |
shouldDismountInWater(Entity rider)
If the rider should be dismounted from the entity when the entity goes under water
|
boolean |
shouldExplodeBlock(Explosion par1Explosion,
World par2World,
int par3,
int par4,
int par5,
int par6,
float par7) |
boolean |
shouldRenderInPass(int pass) |
boolean |
shouldRiderSit()
Used in model rendering to determine if the entity riding this entity should be in the 'sitting' position.
|
String |
toString() |
void |
travelToDimension(int par1)
Teleports the entity to another dimension.
|
void |
updateRidden()
Handles updating while being ridden by an entity
|
void |
updateRiderPosition() |
boolean |
writeMountToNBT(NBTTagCompound par1NBTTagCompound)
Like writeToNBTOptional but does not check if the entity is ridden.
|
void |
writeToNBT(NBTTagCompound par1NBTTagCompound)
Save the entity to NBT (calls an abstract helper method to write extra data)
|
boolean |
writeToNBTOptional(NBTTagCompound par1NBTTagCompound)
Either write this entity to the NBT tag given and return true, or return false without doing anything.
|
public int entityId
public double renderDistanceWeight
public boolean preventEntitySpawning
public Entity riddenByEntity
public Entity ridingEntity
public boolean forceSpawn
public World worldObj
public double prevPosX
public double prevPosY
public double prevPosZ
public double posX
public double posY
public double posZ
public double motionX
public double motionY
public double motionZ
public float rotationYaw
public float rotationPitch
public float prevRotationYaw
public float prevRotationPitch
public final AxisAlignedBB boundingBox
public boolean onGround
public boolean isCollidedHorizontally
public boolean isCollidedVertically
public boolean isCollided
public boolean velocityChanged
public boolean field_70135_K
public boolean isDead
public float yOffset
public float width
public float height
public float prevDistanceWalkedModified
public float distanceWalkedModified
public float distanceWalkedOnStepModified
public float fallDistance
public double lastTickPosX
public double lastTickPosY
public double lastTickPosZ
public float ySize
public float stepHeight
public boolean noClip
public float entityCollisionReduction
public int ticksExisted
public int fireResistance
public int hurtResistantTime
public boolean addedToChunk
public int chunkCoordX
public int chunkCoordY
public int chunkCoordZ
public int serverPosX
public int serverPosY
public int serverPosZ
public boolean ignoreFrustumCheck
public boolean isAirBorne
public int timeUntilPortal
public int dimension
public EnumEntitySize myEntitySize
public boolean captureDrops
public ArrayList<EntityItem> capturedDrops
public Entity(World par1World)
public DataWatcher getDataWatcher()
public void setDead()
public void setPosition(double par1, double par3, double par5)
public void setAngles(float par1, float par2)
public void onUpdate()
public void onEntityUpdate()
public int getMaxInPortalTime()
public void setFire(int par1)
public void extinguish()
public boolean isOffsetPositionInLiquid(double par1, double par3, double par5)
public void moveEntity(double par1, double par3, double par5)
public void playSound(String par1Str, float par2, float par3)
public AxisAlignedBB getBoundingBox()
public final boolean isImmuneToFire()
public boolean isWet()
public boolean isInWater()
public boolean handleWaterMovement()
public boolean isInsideOfMaterial(Material par1Material)
public float getEyeHeight()
public boolean handleLavaMovement()
public void moveFlying(float par1, float par2, float par3)
public int getBrightnessForRender(float par1)
public float getBrightness(float par1)
public void setWorld(World par1World)
public void setPositionAndRotation(double par1, double par3, double par5, float par7, float par8)
public void setLocationAndAngles(double par1, double par3, double par5, float par7, float par8)
public float getDistanceToEntity(Entity par1Entity)
public double getDistanceSq(double par1, double par3, double par5)
public double getDistance(double par1, double par3, double par5)
public double getDistanceSqToEntity(Entity par1Entity)
public void onCollideWithPlayer(EntityPlayer par1EntityPlayer)
public void applyEntityCollision(Entity par1Entity)
public void addVelocity(double par1, double par3, double par5)
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2)
public boolean canBeCollidedWith()
public boolean canBePushed()
public void addToPlayerScore(Entity par1Entity, int par2)
public boolean isInRangeToRenderVec3D(Vec3 par1Vec3)
public boolean isInRangeToRenderDist(double par1)
public boolean writeMountToNBT(NBTTagCompound par1NBTTagCompound)
public boolean writeToNBTOptional(NBTTagCompound par1NBTTagCompound)
public void writeToNBT(NBTTagCompound par1NBTTagCompound)
public void readFromNBT(NBTTagCompound par1NBTTagCompound)
public void onChunkLoad()
public float getShadowSize()
public EntityItem dropItem(int par1, int par2)
public EntityItem dropItemWithOffset(int par1, int par2, float par3)
public EntityItem entityDropItem(ItemStack par1ItemStack, float par2)
public boolean isEntityAlive()
public boolean isEntityInsideOpaqueBlock()
public boolean interactFirst(EntityPlayer par1EntityPlayer)
public AxisAlignedBB getCollisionBox(Entity par1Entity)
public void updateRidden()
public void updateRiderPosition()
public double getYOffset()
public double getMountedYOffset()
public void mountEntity(Entity par1Entity)
public void setPositionAndRotation2(double par1, double par3, double par5, float par7, float par8, int par9)
public float getCollisionBorderSize()
public Vec3 getLookVec()
public void setInPortal()
public int getPortalCooldown()
public void setVelocity(double par1, double par3, double par5)
public void handleHealthUpdate(byte par1)
public void performHurtAnimation()
public ItemStack[] getLastActiveItems()
public void setCurrentItemOrArmor(int par1, ItemStack par2ItemStack)
public boolean isBurning()
public boolean isRiding()
public boolean isSneaking()
public void setSneaking(boolean par1)
public boolean isSprinting()
public void setSprinting(boolean par1)
public boolean isInvisible()
public boolean isInvisibleToPlayer(EntityPlayer par1EntityPlayer)
public void setInvisible(boolean par1)
public boolean isEating()
public void setEating(boolean par1)
public int getAir()
public void setAir(int par1)
public void onStruckByLightning(EntityLightningBolt par1EntityLightningBolt)
public void onKillEntity(EntityLivingBase par1EntityLivingBase)
public void setInWeb()
public String getEntityName()
public Entity[] getParts()
public boolean isEntityEqual(Entity par1Entity)
public float getRotationYawHead()
public void setRotationYawHead(float par1)
public boolean canAttackWithItem()
public boolean hitByEntity(Entity par1Entity)
public boolean isEntityInvulnerable()
public void copyLocationAndAnglesFrom(Entity par1Entity)
public void copyDataFrom(Entity par1Entity, boolean par2)
public void travelToDimension(int par1)
public float getBlockExplosionResistance(Explosion par1Explosion, World par2World, int par3, int par4, int par5, Block par6Block)
public boolean shouldExplodeBlock(Explosion par1Explosion, World par2World, int par3, int par4, int par5, int par6, float par7)
public int getMaxSafePointTries()
public int getTeleportDirection()
public boolean doesEntityNotTriggerPressurePlate()
public void addEntityCrashInfo(CrashReportCategory par1CrashReportCategory)
public boolean canRenderOnFire()
public UUID getUniqueID()
public boolean isPushedByWater()
public String getTranslatedEntityName()
public NBTTagCompound getEntityData()
public boolean shouldRiderSit()
public ItemStack getPickedResult(MovingObjectPosition target)
target
- The full target the player is looking atpublic UUID getPersistentID()
public final void resetEntityId()
public boolean shouldRenderInPass(int pass)
public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount)
type
- The EnumCreatureType type this entity is evaluatingforSpawnCount
- If this is being invoked to check spawn count caps.public String registerExtendedProperties(String identifier, IExtendedEntityProperties properties)
identifier
- The identifier which you can use to retrieve these properties for the entity.properties
- The instanceof IExtendedProperties to registerpublic IExtendedEntityProperties getExtendedProperties(String identifier)
identifier
- The key that identifies the extended properties.public boolean canRiderInteract()
public boolean shouldDismountInWater(Entity rider)
rider
- The entity that is riding