Function pick

Source
pub fn pick(opts: PickOpts<'_, '_, '_, '_, '_>) -> HitResult
Expand description

Get the block or entity that a player would be looking at if their eyes were at the given direction and position.

If you need to get the block/entity the player is looking at right now, use HitResultComponent.

Also see pick_block.