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
readonlyface:"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
readonlyfaceLocation:FaceLocation
Defined in: packages/prismarine/src/item/placementState.ts:70
pitch
readonlypitch: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
readonlyposition:BlockPosition
Defined in: packages/block-behaviors/src/rules/javaPlacement.ts:37
Where the block goes.
Inherited from
PlacementInput.position
replacingClicked
readonlyreplacingClicked: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
readonlysneaking:boolean
Defined in: packages/block-behaviors/src/rules/javaPlacement.ts:45
Whether the placer sneaks, Java's isSecondaryUseActive.
Inherited from
PlacementInput.sneaking
world
readonlyworld:WorldActions
Defined in: packages/block-behaviors/src/rules/javaPlacement.ts:35
Inherited from
PlacementInput.world
yaw
readonlyyaw: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
The server's content, whose block types hold each block's placement trait.
held
string
The Bedrock block the held item places.
input
Where it goes, the face clicked and where on it, the look and the sneak.
Returns
{ identifier: string; states: Record<string, BlockStateValue>; } | null