UNPKG

yoni-mcscripts-lib

Version:

为 Minecraft Script API 中的部分接口创建了 wrapper,并提供简单的事件管理器和任务管理器,另附有一些便于代码编写的一些小工具。

42 lines (41 loc) 1.91 kB
import { Minecraft } from "../basis.js"; import type { DimensionLikeValue } from "../dimensionutils.js"; import type { YoniEntity, YoniPlayer } from "./entity/index.js"; import type { LocationParamsOneArg, Vector3 } from "./Location.js"; /** * 代表维度,一种世界内的空间。 */ declare class Dimension { #private; static isDimensionValue(value: any): boolean; static toDimension(dimid: DimensionLikeValue): Dimension; static isDimension(object: any): object is (Minecraft.Dimension | Dimension); readonly vanillaDimension: Minecraft.Dimension; /** * Identifier of the dimension. * @throws This property can throw when used. */ readonly id: string; /** * @hideconstructor * @param {Minecraft.Dimension} */ protected constructor(vanillaDimension: Minecraft.Dimension); /** * 获取指定位置上的方块对象。 */ getBlock(location: LocationParamsOneArg): Minecraft.Block; getEntities(options?: Minecraft.EntityQueryOptions): YoniEntity[]; getEntitiesAtBlockLocation(location: Vector3): YoniEntity[]; getEntitiesFromRay(location: Vector3, direction: Vector3, options?: Minecraft.EntityRaycastOptions): YoniEntity[]; getPlayers(option?: Minecraft.EntityQueryOptions): YoniPlayer[]; fetchCommand(commandString: string): Promise<import("../command.js").CommandResult>; spawnEntity(identifier: string, location: Vector3): YoniEntity; spawnItem(item: Minecraft.ItemStack, location: Vector3): YoniEntity; } type RemovedKeys = never; type OverridedKeys = "id" | "getBlock" | "getEntities" | "getEntitiesAtBlockLocation" | "getEntitiesFromRay" | "getPlayers" | "spawnEntity" | "spawnItem"; type BaseVanillaDimensionClass = Omit<Minecraft.Dimension, RemovedKeys | OverridedKeys>; interface Dimension extends BaseVanillaDimensionClass { } export { Dimension, Dimension as YoniDimension };