Moxlib
Moxvallix 的数据包创建库
Moxlib 旨在让数据包的创作变得有趣且令人愉悦。
凭借可预测的 API 和对数据驱动功能的专注,Moxlib 成为任何数据包项目的优秀基础。
Moxlib 力求尽可能少地在 tick 函数上运行。数据包中的大多数函数仅在被调用时才会执行。
数据包的另一个重点是即时函数。数据包中的大多数函数都设计为在单个 tick 内运行,不使用调度器或其他基于计时器的方法。
Moxlib 根据 GNU LGPL 许可协议授权,这意味着您可以自由地在自己的数据包中使用它(您的数据包可采用任何许可证),但您对 Moxlib 所做的任何更改都必须根据 LGPL 条款发布。请参阅 LICENSE.md 获取完整许可信息。
欢迎提供建议和贡献!
API
约定
moxlib:api 文件夹之外的任何函数均被视为私有,且不受支持。
以数据存储作为输入的函数,将在与您调用函数时相同的路径下读取和写入数据。
例如:/function moxlib:api/helpers/block/get 会向 /data get storage moxlib:api/helpers/block/get 写入数据。
然而,test 和 tui 模块是例外情况,它们使用更具语义化的语言来处理各自的任务。请参阅其各自的文档。
函数通常会接收一个 target(目标)。可以将其视为主输入,即函数将要操作的数据片段。函数偶尔也会请求其他数据。
如果函数有输出,它们会将结果写入 output。此外,它们可能还会将成功状态记录到 success 标签中,尽管并非所有函数都实现了此功能。
部分函数和模块标记为“实验性”。这些需要 Moxlib Exp 才能正常运行。
模块
Helpers(辅助工具)
查看文档...
Helpers 模块包含一些小型、杂项但有用的函数。
这些函数过于细小和特定,不足以构成单独的模块。
Data(数据)
查看文档...
Data 模块包含专门用于处理 NBT 数据数组的函数。
Test(测试)
查看文档...
Test 模块包含用于测试其他函数的函数。
目前,它只能测试函数是否返回了正确的值。
TUI(文本用户界面)
查看文档...
TUI 模块允许轻松创建数据驱动的文本用户界面。
Math(数学)
查看文档...
Math 模块提供一些有用的数学函数。
Player(玩家)
查看文档...
Player 模块暴露了一些关于玩家的有用信息。
String(字符串)
查看文档...
String 模块提供用于操作字符串的函数。
Dimension(维度)
查看文档...
Moxlib 提供了一个维度,用于存储和访问方块。(需要 Moxlib Exp)
Moxlib
Moxvallix's Datapack Creation Library
Moxlib aims to make Datapack creation fun and enjoyable.
With a predictable API, and a focus on data driven functionality, Moxlib serves
as an excellent foundation to any Datapack project.
Moxlib aims to run as little as possible on the tick function. Most functions
in the pack only run when they are called.
Another focus of the pack is instantaneous functions. Most of the functions
in the pack have been designed to run in a single tick, and do not use schedules,
or other timer based methods.
Moxlib is licensed under the GNU LGPL, meaning you are free to use it in your
own Datapacks, themselves under any license, but any changes you make to Moxlib must
be released under the terms of the LGPL. See LICENSE.md for full license.
Suggestions and contributions welcomed!
The API
Conventions
Any function outside of the moxlib:api folder is considered private, and is not supported.
Functions that take in data storage as an input, will read and write data at the same path
you would use to call the function.
Eg. /function moxlib:api/helpers/block/get writes to /data get storage moxlib:api/helpers/block/get
However, the test and tui modules are an exception, using more semantic language for their
respective tasks. See their individual documentations.
Functions will usually take in a target. Think of this as the main input. It is the piece of
data that the function will manipulate. Functions will occasionally ask for other data as well.
Functions, if they output anything, will write to output. Optionally, they might also record
their success to a success tag, although not all functions implement this.
Some functions and modules are marked as "experimental". These require Moxlib Exp
to function.
Modules
Helpers
See documentation...
The helpers module contains small, miscellaneous, but helpful functions.
These functions are too small and specific to warrant a module of their own.
Data
See documentation...
The data module contains functions specifically for working with arrays of
NBT data.
Test
See documentation...
The test module contains functions for testing other functions.
Currently, it can only test to see that a function returned the correct value.
TUI
See documentation...
The TUI module allows for easy creation of data driven TUIs.
Math
See documentation...
The Math module provides some helpful math functions.
Player
See documentation...
The Player module exposes some helpful information about the player.
String
See documentation...
The String module provides functions to manipulate strings.
Dimension
See documentation...
Moxlib provides a dimension for storing and accessing blocks. (Requires Moxlib Exp)
评论 0
登录后参与评分
还没有评论,来抢沙发吧