UNPKG

yoni-mcscripts-lib

Version:

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

16 lines (15 loc) 437 B
import { Event } from "../index.js"; import { Minecraft } from "../../basis.js"; import { EntityUtils } from "../../EntityUtils.js"; const EntityTypes = Minecraft.EntityTypes; export class PlayerEvent extends Event { constructor(player) { super(); this.#player = EntityUtils.from(player); } #player; get player() { return this.#player; } eventType = EntityTypes.get("minecraft:player"); }