[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / [entity/data/storePlayers](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/storePlayers/index.md) / DetachedPlayerView

# Class: DetachedPlayerView

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:374](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L374)

A store player in no store, as its own client is shown it: from the login to
`SetLocalPlayerAsInitialized`, and between the two stores of a dimension change. Its position,
look and status effects are what the player holds of its entity, its metadata the components'
own, and nobody else is shown it, because no world holds it.

## Implements

- [`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer)

## Constructors

### Constructor

> **new DetachedPlayerView**(`player`, `facts`): `DetachedPlayerView`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:380](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L380)

#### Parameters

##### player

[`StorePlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/storePlayer/classes/StorePlayer.md)

The store player.

##### facts

What the view cannot read off the player: the type's box, which the metadata
  carries, and whether the permission service lists the player as an operator.

###### box

() => [`EntityBox`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/data/facts/index.md#entitybox)

###### commandLevel

() => [`CommandPermissionLevel`](https://jsprismarine.dev/api/@jsprismarine/minecraft/index.md#commandpermissionlevel)

###### isOp

() => `boolean`

#### Returns

`DetachedPlayerView`

## Properties

### player

> `readonly` **player**: [`StorePlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/storePlayer/classes/StorePlayer.md)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:381](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L381)

The store player.

## Accessors

### attributes

#### Get Signature

> **get** **attributes**(): `Attributes`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:432](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L432)

The client's attribute table.

##### Returns

`Attributes`

The attributes a client is sent.

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`attributes`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#attributes)

***

### device

#### Get Signature

> **get** **device**(): [`Device`](https://jsprismarine.dev/api/@jsprismarine/prismarine/utils/Device/classes/Device.md) \| `null`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:469](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L469)

The device the client logged in from, or null when it said nothing.

##### Returns

[`Device`](https://jsprismarine.dev/api/@jsprismarine/prismarine/utils/Device/classes/Device.md) \| `null`

The device the client logged in from, or null when it said nothing.

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`device`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#device)

***

### gamemode

#### Get Signature

> **get** **gamemode**(): [`Gametype`](https://jsprismarine.dev/api/@jsprismarine/minecraft/index.md#gametype)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:477](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L477)

##### Returns

[`Gametype`](https://jsprismarine.dev/api/@jsprismarine/minecraft/index.md#gametype)

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`gamemode`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#gamemode)

***

### headYaw

#### Get Signature

> **get** **headYaw**(): `number`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:413](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L413)

##### Returns

`number`

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`headYaw`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#headyaw)

***

### metadata

#### Get Signature

> **get** **metadata**(): [`Metadata`](https://jsprismarine.dev/api/@jsprismarine/protocol/classes/Metadata.md)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:418](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L418)

The components' metadata, with the player's box and whether its game mode lets it fly.

##### Returns

[`Metadata`](https://jsprismarine.dev/api/@jsprismarine/protocol/classes/Metadata.md)

The actor metadata a client is sent, flags and properties both.

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`metadata`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#metadata)

***

### pitch

#### Get Signature

> **get** **pitch**(): `number`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:405](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L405)

##### Returns

`number`

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`pitch`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#pitch)

***

### platformChatId

#### Get Signature

> **get** **platformChatId**(): `string`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:465](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L465)

##### Returns

`string`

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`platformChatId`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#platformchatid)

***

### skin

#### Get Signature

> **get** **skin**(): [`Skin`](https://jsprismarine.dev/api/@jsprismarine/protocol/classes/Skin.md) \| `null`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:473](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L473)

##### Returns

[`Skin`](https://jsprismarine.dev/api/@jsprismarine/protocol/classes/Skin.md) \| `null`

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`skin`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#skin)

***

### xuid

#### Get Signature

> **get** **xuid**(): `string`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:461](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L461)

##### Returns

`string`

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`xuid`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#xuid)

***

### yaw

#### Get Signature

> **get** **yaw**(): `number`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:409](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L409)

##### Returns

`number`

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`yaw`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#yaw)

## Methods

### getCommandLevel()

> **getCommandLevel**(): [`CommandPermissionLevel`](https://jsprismarine.dev/api/@jsprismarine/minecraft/index.md#commandpermissionlevel)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:487](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L487)

The command level the player runs at, which sets the command permission other clients see.

#### Returns

[`CommandPermissionLevel`](https://jsprismarine.dev/api/@jsprismarine/minecraft/index.md#commandpermissionlevel)

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getCommandLevel`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getcommandlevel)

***

### getEquipment()

> **getEquipment**(): [`ViewableEquipment`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/predicateView/index.md#viewableequipment)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:437](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L437)

#### Returns

[`ViewableEquipment`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/predicateView/index.md#viewableequipment)

#### Inherit Doc

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getEquipment`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getequipment)

***

### getName()

> **getName**(): `string`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:457](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L457)

The name other clients see over the player's head and in the player list.

#### Returns

`string`

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getName`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getname)

***

### getPosition()

> **getPosition**(): [`Vector3`](https://jsprismarine.dev/api/@jsprismarine/math/classes/Vector3.md)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:396](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L396)

#### Returns

[`Vector3`](https://jsprismarine.dev/api/@jsprismarine/math/classes/Vector3.md)

#### Inherit Doc

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getPosition`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getposition)

***

### getRuntimeId()

> **getRuntimeId**(): `bigint`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:386](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L386)

#### Returns

`bigint`

#### Inherit Doc

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getRuntimeId`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getruntimeid)

***

### getStatusEffects()

> **getStatusEffects**(): readonly [`StatusEffect`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/StatusEffect/index.md#statuseffect)[]

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:442](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L442)

#### Returns

readonly [`StatusEffect`](https://jsprismarine.dev/api/@jsprismarine/prismarine/entity/StatusEffect/index.md#statuseffect)[]

#### Inherit Doc

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getStatusEffects`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getstatuseffects)

***

### getSyncedProperties()

> **getSyncedProperties**(): [`SyncedProperties`](https://jsprismarine.dev/api/@jsprismarine/protocol/classes/SyncedProperties.md)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:427](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L427)

None, as a player's type declares none.

#### Returns

[`SyncedProperties`](https://jsprismarine.dev/api/@jsprismarine/protocol/classes/SyncedProperties.md)

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getSyncedProperties`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getsyncedproperties)

***

### getType()

> **getType**(): `string`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:391](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L391)

#### Returns

`string`

#### Inherit Doc

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getType`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#gettype)

***

### getUUID()

> **getUUID**(): [`UUIDValue`](https://jsprismarine.dev/api/@jsprismarine/protocol/classes/UUIDValue.md)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:452](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L452)

The identity the client logged in with.

#### Returns

[`UUIDValue`](https://jsprismarine.dev/api/@jsprismarine/protocol/classes/UUIDValue.md)

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getUUID`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getuuid)

***

### getVelocity()

> **getVelocity**(): [`Vector3`](https://jsprismarine.dev/api/@jsprismarine/math/classes/Vector3.md)

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:401](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L401)

A body in no store does not move.

#### Returns

[`Vector3`](https://jsprismarine.dev/api/@jsprismarine/math/classes/Vector3.md)

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`getVelocity`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#getvelocity)

***

### isFlying()

> **isFlying**(): `boolean`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:492](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L492)

#### Returns

`boolean`

#### Inherit Doc

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`isFlying`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#isflying)

***

### isOnGround()

> **isOnGround**(): `boolean`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:447](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L447)

#### Returns

`boolean`

#### Inherit Doc

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`isOnGround`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#isonground)

***

### isOp()

> **isOp**(): `boolean`

Defined in: [packages/prismarine/src/entity/data/storePlayers.ts:482](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/entity/data/storePlayers.ts#L482)

Whether the player is an operator, which sets the permissions other clients see.

#### Returns

`boolean`

#### Implementation of

[`ShownPlayer`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#shownplayer).[`isOp`](https://jsprismarine.dev/api/@jsprismarine/prismarine/world/ShownPlayer/index.md#isop)
