Mod
WhatsUp
No reviews yet
Query APIs and run functions based on the results
Provides a framework or library for other mods to use.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
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 endpoint-
actions- 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
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 leadingcontext.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.
Screenshots
Gallery
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers