UNPKG

@nxg-org/mineflayer-tracker

Version:

Provides functionality for more accurate entity and projectile tracking.

73 lines (72 loc) 2.46 kB
import { Bot, Effect } from "mineflayer"; import { AABB } from "@nxg-org/mineflayer-util-plugin"; import { Physics } from "../engines/physics"; import { Vec3 } from "vec3"; import { ControlStateHandler } from "../player/playerControls"; import { EntityStateBuilder } from "./entityState"; export declare class EntityDimensions { readonly width: number; readonly height: number; readonly fixed: boolean; constructor(width: number, height: number, fixed: boolean); static scalable(f: number, f2: number): EntityDimensions; static fixed(f: number, f2: number): EntityDimensions; makeBoundingBox(vec3: Vec3): AABB; makeBoundingBoxCoords(d: number, d2: number, d3: number): AABB; scale(f: number): EntityDimensions; scaleRaw(f: number, f2: number): EntityDimensions; toString(): String; } /** * Looking at this code, it's too specified towards players. * * I will eventually split this code into PlayerState and bot.entityState, where bot.entityState contains fewer controls. */ export declare class PlayerState implements EntityStateBuilder { readonly bot: Bot; position: Vec3; velocity: Vec3; onGround: boolean; isInWater: boolean; isInLava: boolean; isInWeb: boolean; isCollidedHorizontally: boolean; isCollidedVertically: boolean; jumpTicks: number; jumpQueued: boolean; sneakCollision: boolean; attributes: any; yaw: number; pitch: number; controlState: ControlStateHandler; isUsingItem: boolean; isUsingMainHand: boolean; isUsingOffHand: boolean; jumpBoost: number; speed: number; slowness: number; dolphinsGrace: number; slowFalling: number; levitation: number; depthStrider: number; effects: Effect[]; statusEffectNames: { jumpBoostEffectName: string; speedEffectName: string; slownessEffectName: string; dolphinsGraceEffectName: string; slowFallingEffectName: string; levitationEffectName: string; }; readonly ctx: Physics; private readonly supportFeature; constructor(ctx: Physics, bot: Bot, control?: ControlStateHandler); update(bot: Bot, control?: ControlStateHandler): PlayerState; apply(bot: Bot): void; clone(): PlayerState; merge(other: PlayerState): this; clearControlStates(): PlayerState; getAABB(): AABB; getUnderlyingBlockBBs(world: any): AABB[]; getSurroundingBBs(world: any): AABB[]; }