Compatibility
Minecraft: Java Edition
26.2
26.1.2
Platforms
Supported environments
Server-side
Singleplayer
Tags
Creators
Details
Licensed MPL-2.0
Published 2 months ago
Ward
Ward lets you write automated tests for your datapacks as plain .mcfunction
files in a test/ folder.

Ward is two pieces that work together:
- 🧩 The Mod (on Modrinth) — a Fabric mod
adding the test commands (
/assert,/await,/fail,/succeed,/dummy) and a headless test server that streams results live. - 🐍 The Tooling (on PyPI) — the
mcwardCLI that installs test servers (fetching Java and the mod for you), runs your packs against one or several Minecraft versions with a live display, plus a beet plugin addingbeet test.
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 |
Console
uv tool install mcward[cli] # or: pip install mcward[cli]
mcward test # discovers datapacks, picks compatible versions, runs
In-Game
/test run <name>- Run a specific test/test runall [namespace]- Run all tests (optionally filtered by namespace)/test runfailed- Re-run previously failed tests/test runthis- Run the closest test/test runthese- Run all tests within 200 blocks
Documentation
- CLI — the
mcwardCLI andbeet test - Dummies — fake players and the
/dummycommand - Directives —
# @timeout,# @environment, ... - Test commands —
/assert,/await,/fail,/succeed - Test environments — world setup/teardown around tests
Acknowledgements
Ward is heavily inspired by packtest by misode.
Ward implements packtest's full command set, so existing packtest tests run
unmodified under Ward. On top of that, Ward adds a few extra commands, a CLI
with multi-version runs and a live test display, and a beet test plugin.


