Download WhatsUp — Minecraft Mods — MetaMods

WhatsUp

Active

Downloads

10

Last update

2 years ago

Versions

1.19.4 — 1.20.1
Server
Forge
Quilt
Libraries
Control
Utils

WhatsUp

The Quilt version requires: QSL and GroovyDuvet

The Forge version requires: GML

WhatsUp is a specialized tool for datapacks that enables servers to periodically query specified web endpoints and execute functions (of the standard .mcfunction type) based on the received results.

The mod introduces two main concepts: listeners and predicates. Listeners are defined in files at data/<namespace>/whatsup/listeners/<name>.json and have the following structure:

  • endpoint - URL address that will be queried by the listener
  • frequency - integer defining the interval in seconds between endpoint queries
  • actions - list of actions performed based on the endpoint response. Each action contains:
    • predicate - predicate identifier for checking the query result
    • function - function identifier that will execute if the predicate check succeeds
    • levels - (optional parameter; default ["overworld"]) list of dimensions where the specified function will run
    • then - (optional) list of other listeners for sequential execution
    • storage - (optional) mapping of property names to command data storages available to the predicate

Predicates are located in files at data/<namespace>/whatsup/predicates/<name>.groovy and represent Groovy scripts. In the Groovy execution environment, predicates have access to the context variable containing the following properties:

  • text - unprocessed response text
  • json - Map with response data in JSON format, or null if the response is not a JSON object
  • storage - contains properties for each data storage specified in the action; storages can be queried and modified

A working datapack example is available in the GitHub releases.

The mod also provides the /whatsup command for convenient datapack testing - it allows immediate execution of any listener.

Project members
lukebemish

lukebemish

Developer

Created: 18 Jun 2023

ID: 14731