Skip to content

BlockHitResult

Inherits from: HitResult

Represents the result of a raycast that hits a block, providing details about the block's position, the side that was hit, and whether the hit was inside the block's boundaries.

Example: Put a glowstone onto the block you look at

local hit = spell.owner:raycastBlock(10)
if hit then
  spell.pos = hit.blockPos
  spell:move(hit.side)
  spell.block = Block("glowstone")
end

Fields

blockPos: Vec3 — Read-Only

A copy of the exact position of the block that was hit.

inside: boolean — Read-Only

Indicates whether the raycast hit was inside the block's boundaries.

side: Side — Read-Only

The side of the block that was hit.