determineBlockFaceLookingAt

fun determineBlockFaceLookingAt(location: Location, maxDistance: Double = 6.0): BlockFace?

Determines the block face an entity with location and direction location is looking at. Stops searching after maxDistance and returns null if no block was found.