MineJSv0.5.1

Player

Source: player.ts:47

Represent a player for calculating physics


Constructors

new Player( state: SharedState, on: (event: K, func: ClientEvents[K] extends any[] ? (args: any[any]) => void : never) => void, entities: EntitiesManager, blocks: BlockManager, ): Player

Parameters

Returns

Player


Properties

sendPlayerPos: (position: BaseVec3, onGround: boolean, horizontalCollision: boolean) => void

sendPlayerPosRot: (position: BaseVec3, angle: Angle, onGround: boolean, horizontalCollision: boolean) => void

sendPlayerRot: (angle: Angle, onGround: boolean, horizontalCollision: boolean) => void

sendPlayerStatus: (onGround: boolean, horizontalCollision: boolean) => void

Methods

collideWithShapes( movement: Vec3, aabb: AABB, colliders: VoxelShape[], ): Vec3

Parameters

Returns

input(input: Input): void

Press and hold a key

Parameters

Returns

  • void

pruneInitialVal(): void

Prune all value

Returns

  • void

releaseAllInputs(): void

Release all key

Returns

  • void

releaseInput(input: Input): void

Release a key

Parameters

Returns

  • void

setAngle(yaw: number, pitch: number): void

Parameters

  • yaw (number)
  • pitch (number)

Returns

  • void

setInitialVal(): void

Set initial value

Returns

  • void

tick(): void

Ticking

Returns

  • void