PlayerLocationOnPlacement

data class PlayerLocationOnPlacement(val position: Vec3 = player.position(), val pose: Pose = player.pose, val rotation: Rotation = RotationManager.serverRotation, val movingHorizontally: Boolean = player.input.keyPresses.anyHorizontal)

Contains the player's state on placement. Everything that depends on the player has to be read from here instead of the live player, so that the aim is derived from one single state.

The state may be a prediction of where the player will be when the block is actually placed (scaffold predicts it to pre-aim). It is only what the aim is derived from: whether the click is possible right now has to be verified against the eye the server will use for the interaction, see BlockPlacementTarget.doesCrosshairTargetMatchRequirements.

Parameters

position

the player's position (on placement)

pose

the player's pose (on placement)

rotation

the rotation to aim from. Target finding keeps the rotation change minimal relative to it

movingHorizontally

whether the player moves horizontally (on placement)

Constructors

Link copied to clipboard
constructor(position: Vec3 = player.position(), pose: Pose = player.pose, rotation: Rotation = RotationManager.serverRotation, movingHorizontally: Boolean = player.input.keyPresses.anyHorizontal)

Properties

Link copied to clipboard
Link copied to clipboard
val eyePos: Vec3
Link copied to clipboard
Link copied to clipboard
val pose: Pose
Link copied to clipboard
val position: Vec3
Link copied to clipboard