EntityPlayerSP

A player entity

Extends

Properties

chasingPosX

chasingPosX: number

The position that the server last reported for this player. Updated every 3 ticks, with the player smoothly moving towards this position over those ticks.

Inherited from

EntityPlayer.chasingPosX


chasingPosY

chasingPosY: number

The position that the server last reported for this player. Updated every 3 ticks, with the player smoothly moving towards this position over those ticks.

Inherited from

EntityPlayer.chasingPosY


chasingPosZ

chasingPosZ: number

The position that the server last reported for this player. Updated every 3 ticks, with the player smoothly moving towards this position over those ticks.

Inherited from

EntityPlayer.chasingPosZ


dimension

dimension: number

The dimension the entity is in: 0 for the Overworld, -1 for the Nether, and 1 for The End

Inherited from

EntityPlayer.dimension


entityID

readonly entityID: number

Inherited from

EntityPlayer.entityID


height

height: number

The height of the entity.

Inherited from

EntityPlayer.height


hurtTime

hurtTime: number

The hurt time in ticks.

Inherited from

EntityPlayer.hurtTime


inventory

readonly inventory: InventoryPlayer

The player inventory.

Inherited from

EntityPlayer.inventory


isDead

isDead: boolean

Inherited from

EntityPlayer.isDead


lastReportedPitch

lastReportedPitch: number

The last reported pitch of the player.


lastReportedPosX

lastReportedPosX: number

The last reported X position of the player.


lastReportedPosY

lastReportedPosY: number

The last reported Y position of the player.


lastReportedPosZ

lastReportedPosZ: number

The last reported Z position of the player.


lastReportedYaw

lastReportedYaw: number

The last reported yaw of the player.


motionX

motionX: number

The X motion (velocity) of the entity.

Inherited from

EntityPlayer.motionX


motionY

motionY: number

The Y motion (velocity) of the entity.

Inherited from

EntityPlayer.motionY


motionZ

motionZ: number

The Z motion (velocity) of the entity.

Inherited from

EntityPlayer.motionZ


onGround

readonly onGround: boolean

Inherited from

EntityPlayer.onGround


posX

posX: number

The X position of the entity.

Inherited from

EntityPlayer.posX


posY

posY: number

The Y position of the entity.

Inherited from

EntityPlayer.posY


posZ

posZ: number

The Z position of the entity.

Inherited from

EntityPlayer.posZ


prevChasingPosX

prevChasingPosX: number

The previous position that the server last reported for this player.

Inherited from

EntityPlayer.prevChasingPosX


prevChasingPosY

prevChasingPosY: number

The previous position that the server last reported for this player.

Inherited from

EntityPlayer.prevChasingPosY


prevChasingPosZ

prevChasingPosZ: number

The previous position that the server last reported for this player.

Inherited from

EntityPlayer.prevChasingPosZ


prevPosX

prevPosX: number

The previous X position of the entity.

Inherited from

EntityPlayer.prevPosX


prevPosY

prevPosY: number

The previous Y position of the entity.

Inherited from

EntityPlayer.prevPosY


prevPosZ

prevPosZ: number

The previous Z position of the entity.

Inherited from

EntityPlayer.prevPosZ


prevRotationPitch

prevRotationPitch: number

The previous pitch rotation of the entity.

Inherited from

EntityPlayer.prevRotationPitch


prevRotationYaw

prevRotationYaw: number

The previous yaw rotation of the entity.

Inherited from

EntityPlayer.prevRotationYaw


rotationPitch

rotationPitch: number

The pitch rotation of the entity.

Inherited from

EntityPlayer.rotationPitch


rotationYaw

rotationYaw: number

The yaw rotation of the entity.

Inherited from

EntityPlayer.rotationYaw


serverSneakState

serverSneakState: boolean

The server-side sneak state of the player.


serverSprintState

serverSprintState: boolean

The server-side sprint state of the player.


ticksAlive

readonly ticksAlive: number

The amount of ticks the entity has existed.

Inherited from

EntityPlayer.ticksAlive


width

width: number

The width of the entity.

Inherited from

EntityPlayer.width

Methods

getCollisionBox()

getCollisionBox(): AxisAlignedBB

Gets the collision box of the entity.

Returns

AxisAlignedBB

Inherited from

EntityPlayer.getCollisionBox


getEntityBoundingBox()

getEntityBoundingBox(): AxisAlignedBB

Returns

AxisAlignedBB

The bounding box of the entity.

Inherited from

EntityPlayer.getEntityBoundingBox


getHealth()

getHealth(): number

Returns

number

The current health of the entity.

Inherited from

EntityPlayer.getHealth


getHeldItem()

getHeldItem(): ItemStack

Returns

ItemStack

The item the entity is currently holding.

Inherited from

EntityPlayer.getHeldItem


getLookVec()

getLookVec(): Vec3

Returns

Vec3

A vector in the direction the entity is looking at. Very useful for raytracing.

Inherited from

EntityPlayer.getLookVec


getMaxHealth()

getMaxHealth(): number

Returns

number

The maximum health of the entity.

Inherited from

EntityPlayer.getMaxHealth


getName()

getName(): string

Returns

string

The name of the player.

Inherited from

EntityPlayer.getName


getPosition()

getPosition(): Vec3

Gets the position of the entity as vec3

Returns

Vec3

Inherited from

EntityPlayer.getPosition


getPositionEyes()

getPositionEyes(): Vec3

Gets the position of the eyes as vec3.

Returns

Vec3

Inherited from

EntityPlayer.getPositionEyes


getUUID()

getUUID(): string

Returns

string

The players UUID as string

Inherited from

EntityPlayer.getUUID


heal()

heal(amount): void

Heals the entity by the specified amount of health.

Parameters

amount

number

The amount of health to heal.

Returns

void

Inherited from

EntityPlayer.heal


isBurning()

isBurning(): boolean

Returns

boolean

If the entity is burning.

Inherited from

EntityPlayer.isBurning


isEating()

isEating(): boolean

Returns

boolean

If the entity is eating.

Inherited from

EntityPlayer.isEating


isInWater()

isInWater(): boolean

Returns

boolean

If the entity is in water.

Inherited from

EntityPlayer.isInWater


isRiding()

isRiding(): boolean

Returns

boolean

If the entity is riding something.

Inherited from

EntityPlayer.isRiding


isSneaking()

isSneaking(): boolean

Returns

boolean

If the entity is sneaking.

Inherited from

EntityPlayer.isSneaking


isSprinting()

isSprinting(): boolean

Returns

boolean

If the entity is sprinting.

Inherited from

EntityPlayer.isSprinting


isWet()

isWet(): boolean

Returns

boolean

If the entity is wet. LOL

Inherited from

EntityPlayer.isWet


setEntityBoundingBox()

setEntityBoundingBox(aabb): void

Sets the bounding box of the entity.

Parameters

aabb

AxisAlignedBB

Returns

void

Inherited from

EntityPlayer.setEntityBoundingBox


setHealth()

setHealth(amount): void

Sets the health of the entity to the specified amount of health.

Parameters

amount

number

The amount of health to set the entity to.

Returns

void

Inherited from

EntityPlayer.setHealth


setOnGround()

setOnGround(onGround): void

Sets the entities onGround state.

Parameters

onGround

boolean

Returns

void

Inherited from

EntityPlayer.setOnGround


setPosition()

setPosition(x, y, z): void

Sets the position and updates its bounding box.

Parameters

x

number

y

number

z

number

Returns

void

Inherited from

EntityPlayer.setPosition


setSneaking()

setSneaking(sneaking): void

Sets the entities sneaking state.

Parameters

sneaking

boolean

Returns

void

Inherited from

EntityPlayer.setSneaking


setSprinting()

setSprinting(sprinting): void

Sets the entities sprinting state.

Parameters

sprinting

boolean

Returns

void

Inherited from

EntityPlayer.setSprinting


swingItem()

swingItem(): void

Makes the player swing their arm clientside and also sends a C0APacketAnimation to the server.

Returns

void

Last updated