getHighestSafeLocationFromTop

fun Location.getHighestSafeLocationFromTop(startFrom: Int = 256): Location

Determines the highest non-air block location from the specified start height and returns a safe location above it.

Return

The location of the highest safe block, which is two blocks above the first non-air block encountered.

Parameters

startFrom

The y-coordinate to start the search from, defaulting to 256. The method iterates downward from this height.