Block Placement Target
data class BlockPlacementTarget(val interactedBlockPos: BlockPos, val placedBlock: BlockPos, val direction: Direction, val interactionPoint: Vec3, val minPlacementY: Double, val rotation: Rotation)
Properties
Link copied to clipboard
Link copied to clipboard
BlockPos which is right-clicked
Link copied to clipboard
Exact point on interactedBlockPos selected by target finding.
Link copied to clipboard
Lower bound (world y) of the shape box interactionPoint was sampled from. One block face can consist of several boxes lying in the same plane (a stair's north face is a lower slab box plus an upper step box), which direction alone cannot tell apart.
Link copied to clipboard
Block pos at which a new block is placed
Link copied to clipboard
The rotation aiming at interactionPoint. It is derived from the (possibly predicted) PlayerLocationOnPlacement.eyePos, so a click has to be verified from the eye the server will use.
Functions
Link copied to clipboard
Link copied to clipboard
fun BlockPlacementTarget.verifyClick(rotation: Rotation = this.rotation, range: Double = max(player.blockInteractionRange(), player.entityInteractionRange()), trace: ClickTrace = ClickTrace.WORLD, onFailure: FailedClick = FailedClick.NOTHING): BlockHitResult?
Verifies that this target can be clicked right now, i.e. that the interaction would be accepted.