Class: Player
Represents a player within the world.
Extends
Constructors
new Player()
private
new Player():Player
Returns
Overrides
Properties
camera
readonly
camera:Camera
Remarks
The player's Camera.
Throws
This property can throw when used.
dimension
readonly
dimension:Dimension
Remarks
Dimension that the entity is currently within.
Throws
This property can throw when used.
Inherited from
fallDistance
Beta
readonly
fallDistance:number
Remarks
The distance an entity has fallen. The value is reset when the entity is teleported. The value is always 1 when gliding with Elytra.
Throws
This property can throw when used.
Inherited from
id
readonly
id:string
Remarks
Unique identifier of the entity. This identifier is intended to be consistent across loads of a world instance. No meaning should be inferred from the value and structure of this unique identifier - do not parse or interpret it. This property is accessible even if Entity.isValid is false.
Inherited from
isClimbing
readonly
isClimbing:boolean
Remarks
Whether the entity is touching a climbable block. For example, a player next to a ladder or a spider next to a stone wall.
Throws
This property can throw when used.
Inherited from
isEmoting
readonly
isEmoting:boolean
Remarks
If true, the player is currently emoting.
Throws
This property can throw when used.
isFalling
readonly
isFalling:boolean
Remarks
Whether the entity has a fall distance greater than 0, or greater than 1 while gliding.
Throws
This property can throw when used.
Inherited from
isFlying
readonly
isFlying:boolean
Remarks
Whether the player is flying. For example, in Creative or Spectator mode.
Throws
This property can throw when used.
isGliding
readonly
isGliding:boolean
Remarks
Whether the player is gliding with Elytra.
Throws
This property can throw when used.
isInWater
readonly
isInWater:boolean
Remarks
Whether any part of the entity is inside a water block.
Throws
This property can throw when used.
Inherited from
isJumping
readonly
isJumping:boolean
Remarks
Whether the player is jumping. This will remain true while the player is holding the jump action.
Throws
This property can throw when used.
isOnGround
readonly
isOnGround:boolean
Remarks
Whether the entity is on top of a solid block. This property may behave in unexpected ways. This property will always be true when an Entity is first spawned, and if the Entity has no gravity this property may be incorrect.
Throws
This property can throw when used.
Inherited from
isSleeping
readonly
isSleeping:boolean
Remarks
If true, the entity is currently sleeping.
Throws
This property can throw when used.
Inherited from
isSneaking
isSneaking:
boolean
Remarks
Whether the entity is sneaking - that is, moving more slowly and more quietly.
This property can't be edited in read-only mode.