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

13 lines
695 B
TypeScript

import type {Bot} from '@wp2508/mineflayer';
import type {BaseFunction} from '../../../types/bot/function/function.ts';
import {entity_arguments, run_entity_operation, type NearestItemArgs} from './shared.ts';
export class init implements BaseFunction<NearestItemArgs> {
readonly name = 'use_item_on_nearest_entity';
readonly i18n = {lang: 'zh-CN', name: '对最近实体使用物品', description: '对指定距离内名称匹配的最近实体使用指定手的物品,可选瞄准'};
readonly args = entity_arguments(true, true);
async run(bot: Bot, args: NearestItemArgs): Promise<boolean> {
return run_entity_operation(bot, args, true, 'item', this.name);
}
}