@nxg-org/mineflayer-util-plugin
Version:
mineflayer utils for NextGEN mineflayer plugins.
39 lines (38 loc) • 1.39 kB
TypeScript
import { Bot, EquipmentDestination } from "mineflayer";
import { Item } from "prismarine-item";
/**
* Error codes:
*
* 0 = completed successfully.
*
* 1 = Item is already equipped.
*
* 2 = Item could not be found.
*
* 3 = We are currently equipping an item.
*/
export declare class InventoryFunctions {
bot: Bot;
private _equippingMainHand;
private _equippingOffHand;
private _equippingOtherSlot;
usingMainHand: boolean;
usingOffHand: boolean;
constructor(bot: Bot);
set equippingOtherSlot(value: boolean);
get equippingOtherSlot(): boolean;
set equippingMainHand(value: boolean);
get equippingMainHand(): boolean;
set equippingOffHand(value: boolean);
get equippingOffHand(): boolean;
get equipmentSlots(): EquipmentDestination[];
getAllItems(): Item[];
getAllItemsExceptCurrent(current: EquipmentDestination): Item[];
getHandWithItem(offhand?: boolean): Item | null;
getHand(offhand?: boolean): "hand" | "off-hand";
findItemByID(itemId: number, metadata?: number): Item | null;
findItem(name: string, metadata?: number): Item | null;
has(name: string, metadata?: number): boolean;
equipItemRaw(item: Item, dest: EquipmentDestination): Promise<boolean>;
customEquip(item: Item, destination: EquipmentDestination, retries?: number): Promise<boolean>;
}