[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / item/placementState

# item/placementState

## Interfaces

### PlacementStateInput

Defined in: [packages/prismarine/src/item/placementState.ts:69](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/item/placementState.ts#L69)

What a placement needs beyond Java's own input: where on the clicked face the click landed.

#### Extends

- `PlacementInput`

#### Properties

##### face

> `readonly` **face**: `"south"` \| `"west"` \| `"north"` \| `"east"` \| `"down"` \| `"up"`

Defined in: [packages/block-behaviors/src/rules/javaPlacement.ts:39](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/block-behaviors/src/rules/javaPlacement.ts#L39)

The face of the block that was clicked, Java's `getClickedFace`.

###### Inherited from

`PlacementInput.face`

##### faceLocation

> `readonly` **faceLocation**: [`FaceLocation`](https://jsprismarine.dev/api/@jsprismarine/blocks/index.md#facelocation-3)

Defined in: [packages/prismarine/src/item/placementState.ts:70](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/item/placementState.ts#L70)

##### pitch

> `readonly` **pitch**: `number`

Defined in: [packages/block-behaviors/src/rules/javaPlacement.ts:43](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/block-behaviors/src/rules/javaPlacement.ts#L43)

The placer's pitch in degrees, negative looking up.

###### Inherited from

`PlacementInput.pitch`

##### position

> `readonly` **position**: [`BlockPosition`](https://jsprismarine.dev/api/@jsprismarine/blocks/index.md#blockposition)

Defined in: [packages/block-behaviors/src/rules/javaPlacement.ts:37](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/block-behaviors/src/rules/javaPlacement.ts#L37)

Where the block goes.

###### Inherited from

`PlacementInput.position`

##### replacingClicked

> `readonly` **replacingClicked**: `boolean`

Defined in: [packages/block-behaviors/src/rules/javaPlacement.ts:47](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/block-behaviors/src/rules/javaPlacement.ts#L47)

Whether the block replaces the one clicked rather than going against its face.

###### Inherited from

`PlacementInput.replacingClicked`

##### sneaking

> `readonly` **sneaking**: `boolean`

Defined in: [packages/block-behaviors/src/rules/javaPlacement.ts:45](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/block-behaviors/src/rules/javaPlacement.ts#L45)

Whether the placer sneaks, Java's `isSecondaryUseActive`.

###### Inherited from

`PlacementInput.sneaking`

##### world

> `readonly` **world**: [`WorldActions`](https://jsprismarine.dev/api/@jsprismarine/block-behaviors/index.md#worldactions)

Defined in: [packages/block-behaviors/src/rules/javaPlacement.ts:35](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/block-behaviors/src/rules/javaPlacement.ts#L35)

###### Inherited from

`PlacementInput.world`

##### yaw

> `readonly` **yaw**: `number`

Defined in: [packages/block-behaviors/src/rules/javaPlacement.ts:41](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/block-behaviors/src/rules/javaPlacement.ts#L41)

The placer's yaw in degrees, 0 looking south and 90 looking west.

###### Inherited from

`PlacementInput.yaw`

## Functions

### placementStateOf()

> **placementStateOf**(`content`, `held`, `input`): \{ `identifier`: `string`; `states`: `Record`\<`string`, [`BlockStateValue`](https://jsprismarine.dev/api/@jsprismarine/prismarine/block/state/BlockState/index.md#blockstatevalue)\>; \} \| `null`

Defined in: [packages/prismarine/src/item/placementState.ts:80](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/item/placementState.ts#L80)

The block and states a held block goes down as, or null where the placement is refused.

#### Parameters

##### content

[`ServerContent`](https://jsprismarine.dev/api/@jsprismarine/prismarine/content/ServerContent/index.md#servercontent)

The server's content, whose block types hold each block's placement trait.

##### held

`string`

The Bedrock block the held item places.

##### input

[`PlacementStateInput`](#placementstateinput)

Where it goes, the face clicked and where on it, the look and the sneak.

#### Returns

\{ `identifier`: `string`; `states`: `Record`\<`string`, [`BlockStateValue`](https://jsprismarine.dev/api/@jsprismarine/prismarine/block/state/BlockState/index.md#blockstatevalue)\>; \} \| `null`
