Skip to content

API reference / @jsprismarine/prismarine / item/placementState

item/placementState ​

Interfaces ​

PlacementStateInput ​

Defined in: packages/prismarine/src/item/placementState.ts:69

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

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

Inherited from ​

PlacementInput.face

faceLocation ​

readonly faceLocation: FaceLocation

Defined in: packages/prismarine/src/item/placementState.ts:70

pitch ​

readonly pitch: number

Defined in: packages/block-behaviors/src/rules/javaPlacement.ts:43

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

Inherited from ​

PlacementInput.pitch

position ​

readonly position: BlockPosition

Defined in: packages/block-behaviors/src/rules/javaPlacement.ts:37

Where the block goes.

Inherited from ​

PlacementInput.position

replacingClicked ​

readonly replacingClicked: boolean

Defined in: packages/block-behaviors/src/rules/javaPlacement.ts:47

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

Whether the placer sneaks, Java's isSecondaryUseActive.

Inherited from ​

PlacementInput.sneaking

world ​

readonly world: WorldActions

Defined in: packages/block-behaviors/src/rules/javaPlacement.ts:35

Inherited from ​

PlacementInput.world

yaw ​

readonly yaw: number

Defined in: packages/block-behaviors/src/rules/javaPlacement.ts:41

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>; } | null

Defined in: packages/prismarine/src/item/placementState.ts:80

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

Parameters ​

content ​

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

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

Returns ​

{ identifier: string; states: Record<string, BlockStateValue>; } | null