@nxg-org/mineflayer-physics-util
Version:
Provides functionality for more accurate entity and projectile tracking.
58 lines (57 loc) • 2.09 kB
TypeScript
import { Entity } from "prismarine-entity";
import { EPhysicsCtx } from "../physics/settings";
import { AABB } from "@nxg-org/mineflayer-util-plugin";
import md from "minecraft-data";
import { Vec3 } from "vec3";
export declare function makeSupportFeature(mcData: md.IndexedData): (feature: string) => boolean;
type SupportFeature = ReturnType<typeof makeSupportFeature>;
export declare const DefaultPlayer: md.Entity;
export declare function applyMdToNewEntity(ctx: typeof EPhysicsCtx, entityType?: md.Entity, options?: Partial<Entity>): Entity;
export declare enum CheapEffects {
JUMP_BOOST = 0,
SPEED = 1,
SLOWNESS = 2,
DOLPHINS_GRACE = 3,
SLOW_FALLING = 4,
LEVITATION = 5,
BLINDNESS = 6
}
export declare enum CheapEnchantments {
DEPTH_STRIDER = 0,
SWIFT_SNEAK = 1,
SOUL_SPEED = 2
}
export declare function isEntityUsingItem(entity: Entity, supportFeature: SupportFeature): boolean;
export declare function whichHandIsEntityUsing(entity: Entity, supportFeature: SupportFeature): "hand" | "off-hand";
export declare function whichHandIsEntityUsingBoolean(entity: Entity, supportFeature: SupportFeature): boolean;
export declare function getStatusEffectNamesForVersion(supportFeature: SupportFeature): {
jumpBoostEffectName: string;
speedEffectName: string;
slownessEffectName: string;
dolphinsGraceEffectName: string;
slowFallingEffectName: string;
levitationEffectName: string;
blindnessEffectName: string;
};
export declare function getEnchantmentNamesForVersion(supportFeature: ReturnType<typeof makeSupportFeature>): {
depthStriderEnchantmentName: string;
swiftSneakEnchantmentName: string;
soulSpeedEnchantmentName: string;
};
export declare function getBetweenRectangle(src: AABB, dest: AABB): AABB;
export declare function getLookingVector(entity: {
yaw: number;
pitch: number;
}): {
yaw: number;
pitch: number;
sinYaw: number;
cosYaw: number;
sinPitch: number;
cosPitch: number;
lookX: number;
lookY: number;
lookZ: number;
lookDir: Vec3;
};
export {};