function getNearbyEntities(bot, maxDistance=16) {
    let entities = [];
    for (const entity of Object.values(bot.entities)) {
        const distance = entity.position.distanceTo(bot.entity.position);
        if (distance > maxDistance) continue;
        entities.push({ entity: entity, distance: distance });
    }
    entities.sort((a, b) => a.distance - b.distance);
    let res = [];
    for (let i = 0; i < entities.length; i++) {
        res.push(entities[i].entity);
    }
    return res;
}
Get the nearest block of the given type.
@param {Bot} bot - The bot to get the nearest block for.
@param {string} block_type - The name of the block to search for.
@param {number} distance - The maximum distance to search, default 16.
@returns {Block} - The nearest block of the given type.
@example
let coalBlock = world.getNearestBlock(bot, 'coal_ore', 16);