
Observer
Unit testing for Datapacks.
Overview
Currently this project is in early alpha. It is based on the unit testing functionality from moxlib, although has been moved in to its own project for further love and attention.
The current syntax of Observer is inspired by RSpec.
If you have multiple tests you would like to run at once, place them in functions,
then add those functions to the tag #observer:api/test. Each of the functions must also
call observer:api/perform themselves.
When you run observer:api/start, it will run all the tests at once, and number them.
API
Perform
Checks that the receives tag matches the expects tag.
A test should first run the function needing to be tested, and set the output
of the function into the receives tag.
Note The test suite does not follow the same syntax as the other functions.
Function: observer:api/perform
Storage: observer:test/it
Expects:
describes-- the name of the test, as a stringexpects-- the expected NBT datareceives-- the data received from the function output Returns: The function will tellraw to the executing player the results.
Example:
/function example:return_true
/data modify storage observer:test/it describes set value "always returns true"
/data modify storage observer:test/it expects set value true
/data modify storage observer:test/it receives set from storage example:return_true output
/function observer:api/perform
---
*1 Passed: "always returns true"*
Start
Runs the tests as listed in #observer:api/test.
Function: observer:api/start
Expects: No value expected
Returns: No value returned
Example:
/function observer:api/start
---
*1 Passed: "always returns true"*
*2 Passed: "always returns false"*
*3 Failed: "should returns true"*
- Expected: true
- Received: false
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 24w12a, 24w13a, 24w14a
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Modrinth — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — see the MC Java Mods guides for the full walkthrough.
- Downloads as observer-v0.1.0-alpha.zip
- Download size: 10 KB
- Download link checked 7 Sept 2026 — working
These come from our own check of the pack file, not from the source page.