Entity
The base class for all entities.
Extended by
Properties
dimension
dimension:
number
The dimension the entity is in: 0 for the Overworld, -1 for the Nether, and 1 for The End
entityID
readonlyentityID:number
height
height:
number
The height of the entity.
isDead
isDead:
boolean
motionX
motionX:
number
The X motion (velocity) of the entity.
motionY
motionY:
number
The Y motion (velocity) of the entity.
motionZ
motionZ:
number
The Z motion (velocity) of the entity.
onGround
readonlyonGround:boolean
posX
posX:
number
The X position of the entity.
posY
posY:
number
The Y position of the entity.
posZ
posZ:
number
The Z position of the entity.
prevPosX
prevPosX:
number
The previous X position of the entity.
prevPosY
prevPosY:
number
The previous Y position of the entity.
prevPosZ
prevPosZ:
number
The previous Z position of the entity.
prevRotationPitch
prevRotationPitch:
number
The previous pitch rotation of the entity.
prevRotationYaw
prevRotationYaw:
number
The previous yaw rotation of the entity.
rotationPitch
rotationPitch:
number
The pitch rotation of the entity.
rotationYaw
rotationYaw:
number
The yaw rotation of the entity.
ticksAlive
readonlyticksAlive:number
The amount of ticks the entity has existed.
width
width:
number
The width of the entity.
Methods
getCollisionBox()
getCollisionBox():
AxisAlignedBB
Gets the collision box of the entity.
Returns
getEntityBoundingBox()
getEntityBoundingBox():
AxisAlignedBB
Returns
The bounding box of the entity.
getLookVec()
getLookVec():
Vec3
Returns
A vector in the direction the entity is looking at. Very useful for raytracing.
getPosition()
getPosition():
Vec3
Gets the position of the entity as vec3
Returns
getPositionEyes()
getPositionEyes():
Vec3
Gets the position of the eyes as vec3.
Returns
isBurning()
isBurning():
boolean
Returns
boolean
If the entity is burning.
isEating()
isEating():
boolean
Returns
boolean
If the entity is eating.
isInWater()
isInWater():
boolean
Returns
boolean
If the entity is in water.
isRiding()
isRiding():
boolean
Returns
boolean
If the entity is riding something.
isSneaking()
isSneaking():
boolean
Returns
boolean
If the entity is sneaking.
isSprinting()
isSprinting():
boolean
Returns
boolean
If the entity is sprinting.
isWet()
isWet():
boolean
Returns
boolean
If the entity is wet. LOL
setEntityBoundingBox()
setEntityBoundingBox(
aabb):void
Sets the bounding box of the entity.
Parameters
aabb
Returns
void
setOnGround()
setOnGround(
onGround):void
Sets the entities onGround state.
Parameters
onGround
boolean
Returns
void
setPosition()
setPosition(
x,y,z):void
Sets the position and updates its bounding box.
Parameters
x
number
y
number
z
number
Returns
void
setSneaking()
setSneaking(
sneaking):void
Sets the entities sneaking state.
Parameters
sneaking
boolean
Returns
void
setSprinting()
setSprinting(
sprinting):void
Sets the entities sprinting state.
Parameters
sprinting
boolean
Returns
void
Last updated