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

13 lines
711 B
TypeScript

import type {Bot} from '@wp2508/mineflayer';
import type {BaseFunction} from '../../../types/bot/function/function.ts';
import {entity_arguments, run_entity_operation, type NearestArgs} from './shared.ts';
export class init implements BaseFunction<NearestArgs> {
readonly name = 'open_nearest_entity_container';
readonly i18n = {lang: 'zh-CN', name: '打开最近实体容器', description: '激活指定距离内名称匹配的最近实体并等待新窗口,已有窗口时失败,最多等待五秒'};
readonly args = entity_arguments(true, false);
async run(bot: Bot, args: NearestArgs): Promise<boolean> {
return run_entity_operation(bot, args, true, 'open', this.name);
}
}