Files
node_server/bot/function/block/destroy_nearest_block.ts
2026-10-22 17:07:08 +08:00

13 lines
676 B
TypeScript

import type {Bot} from '@wp2508/mineflayer';
import type {BaseFunction} from '../../../types/bot/function/function.ts';
import {block_arguments, run_block_operation, type NearestArgs} from './shared.ts';
export class init implements BaseFunction<NearestArgs> {
readonly name = 'destroy_nearest_block';
readonly i18n = {lang: 'zh-CN', name: '破坏最近方块', description: '破坏范围内名称匹配且距离眼睛最近的已加载方块,不自动移动或切换工具'};
readonly args = block_arguments('nearest');
async run(bot: Bot, args: NearestArgs): Promise<boolean> {
return run_block_operation(bot, args, 'nearest', 'destroy');
}
}