UNPKG

@nxg-org/mineflayer-physics-util

Version:

Provides functionality for more accurate entity and projectile tracking.

25 lines (24 loc) 996 B
import { AABB } from "@nxg-org/mineflayer-util-plugin"; import { IndexedData } from "minecraft-data"; import { Effect } from "mineflayer"; import { Entity } from "prismarine-entity"; import { CheapEffects, CheapEnchantments, makeSupportFeature } from "../../util/physicsUtils"; import { EPhysicsCtx } from "../settings/entityPhysicsCtx"; import { IEntityState } from "../states"; export type MobsByName = { [mobName: string]: Entity; }; export interface IPhysics { data: IndexedData; supportFeature: ReturnType<typeof makeSupportFeature>; getEffectLevel: (effect: CheapEffects, effects: Effect[]) => number; getEnchantmentLevel: (effect: CheapEnchantments, enchantments: any[]) => number; getSurroundingBBs(queryBB: AABB, world: any): AABB[]; simulate(simCtx: EPhysicsCtx, world: any): IEntityState; readonly statusEffectNames: { [type in CheapEffects]: string; }; readonly enchantmentNames: { [type in CheapEnchantments]: string; }; }