介绍
WhatsUp
Quilt version requires: QSL and GroovyDuvet
Forge version requires: GML
WhatsUp is a tool for datapacks that allows servers to query a provided web endpoint at a given frequency, and execute
functions (the normal .mcfunction type) based on the results returned by that endpoint.
WhatsUp defines both listeners and predicates. listeners are defined at data/<namespace>/whatsup/listeners/<name>.json,
and take the following structure:
endpoint– The URL to be queried by the listenerfrequency– An integer representing how many seconds should pass between queries of the endpointactions– A list of actions to do based on the returned result of the endpoint. Each takes the following form:predicate– The resource location of a predicate to check against the endpoint’s resultfunction– The resource location of a function to execute if the predicate passeslevels– (Optional; defaults to["overworld"]) A list of dimensions to run the provided function inthen– (Optional) a list of locations of other listeners to chain after this listenerstorage– (Optional) a map of property names to resource locations specifying command data storage that the predicate has access to
Predicates are stored at data/<namespace>/whatsup/predicates/<name>.groovy, and are groovy scripts. The groovy environment
the predicates run in has access to the context variable, which has the following properties:
text– The unprocessed response textjson– The a Map of the response parsed as JSON, ornullif the response is not a JSON objectstorage– Contains a property for every command data storage specified in the action; data storages can be queried and mutated.
This context object is also available as the delegate of the script, so a leading context. to access these properties is optional.
An example datapack can be found on the GitHub releases.
The mod also provides the /whatsup command for easily testing datapacks; this can be used to run any listener immediately.
常见问题
WhatsUp 支持哪些 Minecraft 版本?
WhatsUp 支持 Minecraft Java 版 1.19.4–1.20.1,共 2 个版本,可用的加载器:Forge / Quilt。下载时注意选择和你游戏版本一致的文件。
WhatsUp 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Forge / Quilt,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:仅服务端。
lukebemish 的其他作品
查看全部 →Dynamic Asset Generator
用于在运行时动态生成资源的前置模组。
Revamped Phantoms
让幻翼变得危险得多
Excavated Variants
自动生成的矿石石头变种
Cobbled Paths
Various cobbled and paved paths for faster and aesthetic streets
评论
登录后评论和评分