A testing framework for Minecraft datapacks using mcfunction.
Project description
Ward
A testing framework for Minecraft datapacks using mcfunction.
Ward lets you write automated tests for your datapacks as plain .mcfunction
files in a test/ folder, executed through Minecraft's GameTest framework on
a real server — in-game, headless in CI, or live-reloading in daemon mode
while you develop.
Ward is two pieces that work together:
- The mod (Modrinth) — a Fabric mod
adding the test commands (
/assert,/await,/fail,/succeed,/dummy) and a headless test server that streams results live. - The tooling (PyPI) — the
mcwardCLI that installs test servers, runs your packs against one or several Minecraft versions with a live display, plus a beet plugin addingbeet test.
Quick start
uv tool install mcward[cli] # or: pip install mcward[cli]
mcward test # discovers datapacks, picks compatible versions, runs
Write tests in your datapack under data/<namespace>/test/:
# @timeout 100
summon minecraft:armor_stand ~ ~ ~ {Tags: ["target"]}
assert entity @e[tag=target]
await not entity @e[tag=target]
Test files support directives (# @timeout, # @optional, # @dummy,
# @template, # @environment, # @skyaccess) and the full command set:
| Command | Purpose |
|---|---|
assert [not] block/entity/data/score/chat/biome/predicate/items ... |
Assert immediately |
await [not] ... |
Retry every tick until true or timeout |
await delay <time> |
Pause the test |
fail [message] / succeed |
End the test explicitly |
dummy <player> spawn/leave/jump/use/attack/mine/... |
Control fake players |
Documentation
- Test commands —
/assert,/await,/fail,/succeed - Directives —
# @timeout,# @environment, ... - Test environments — world setup/teardown around tests
- Dummies — fake players and the
/dummycommand - Command-line tooling — the
mcwardCLI andbeet test
Commands
mcward test [-v <version>]... [-p <pack>]... [selector] # run tests (default command)
mcward install [version] # install a test server
mcward start / stop / status # manage the test daemon
mcward list [--remote] # installed / available versions
beet test # build the beet project and test it
Development
Requires uv, just, a JDK, and Gradle (wrapper included).
uv sync --all-extras # set up the workspace
just check # lint + types + unit tests
just verify # build the mod and run the full integration suite
Layout: the Fabric mod lives in src/, the Python packages in packages/
(mcward-core, mcward-cli, mcward-beet), tooling in tools/, and the
integration fixture datapacks in tests/packs/. Releases are automated from
the versions committed to the tree — see
CONTRIBUTING.md for the guidelines and workflow.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcward-1.0.0.tar.gz.
File metadata
- Download URL: mcward-1.0.0.tar.gz
- Upload date:
- Size: 217.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
258b974d8678c682a37879bd60c5bc1ba047392facf5f72c050a72a8dcf17f4b
|
|
| MD5 |
27d16e3983149688c887afe754d8fac0
|
|
| BLAKE2b-256 |
18bbabbc384cd7099a4e2a10102087ae4852b3b93f5ea4e29dd40759829bb394
|
File details
Details for the file mcward-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mcward-1.0.0-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.11.27 {"installer":{"name":"uv","version":"0.11.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eed420880d540e256486f811e6df5c755c683fe936d2410f0fd97514b4e2bb05
|
|
| MD5 |
f6bbd3bb17ee4ca4ccceadf12249d019
|
|
| BLAKE2b-256 |
6d537b269fca3302e9387f7d2dd471572b7533d947e43d77a5d708677ab5267c
|