UNPKG

@occultus/entity-api

Version:

Star Tenon entity api and utils

51 lines (32 loc) 2.17 kB
# Star Tenon Entity API & Utils 这个包提供了方块实体 API 和一些实用工具。 ## EntityUtils/EntitiesUtils `EntityUtils`提供了诸多实用工具,它们只能操作单一实体,以函数的形式提供。 而`EntitiesUtils`则提供了批量操作实体的工具,以类的方法提供: ```ts // EntityUtils 的一个例子 giveItem(entity, new ItemStack("example:bakabee")); // EntitiesUtils 的一个例子 new EntitiesUtils(world.getDimension("minecraft:overworld"), { location: { x: 0, y: 0, z: 0 } maxDistance: 10, }).giveItem(new ItemStack("example:bakabee")); ``` 由于提供的方法比较多,这里不再逐一列举,具体可以参考源码。 ## BlockEntity ## 支持版本 本 API 支持任意可以运行 Script API v2.0.0+ 的游戏版本,包括: - 1.21.90; - 1.21.100; - 1.21.110; - 以及更多…… 注意:本包理论上可以在部分更旧的版本上运作,但未经过严格的测试。 ## 协议 本项目使用 MIT License 授权: ```text The MIT License (MIT) Copyright © 2025 CTN Studios Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ```