PackTest
🟡 Updated this year⚠️ Install Order · 2 steps
Install in this order, then this mod last — most mods fail to load without their framework and dependencies in place.
🖼️ Gallery (3 images)
🔍 Analysis
- 👍 0.1% endorsement rate
- 🏆 #199 of 901 fabric mods in this game by downloads
📋 About This Mod
# PackTest PackTest allows you to write game tests in a data pack. Tests are `*.mcfunction` files in a `test` folder. They can be used to test custom data packs. ## Example **`data/example/test/foo.mcfunction`** ```mcfunction #> Summons an armor stand and finds it # @template example:small_platform # @optional summon armor_stand ~1.5 ~1 ~1.5 execute positioned ~1.5 ~1 ~1.5 run assert entity @e assert predicate example:test setblock ~1 ~1 ~1 grass_block execute if block ~1 ~1 ~1 stone run succeed fail "Oh no" ``` ### Async tests Test functions can be asynchronous, using the `await` keyword! ```mcfunction setblock ~ ~ ~ stone summon item ~ ~6 ~ await entity @e await delay 1s data merge entity @e {Motion: } ``` ## Running tests Tests can be run in-game using the `test` command. * `test runall`: runs all the tests * `test runall <namespace>`: runs all tests from a specified namespace * `test run <test>`: runs the test with a specified name * `test runfailed`: runs all the previously failed tests * `test runthis`: runs the closes test * `test runthese`: runs all tests within 200 blocks ### Auto test server Tests can also be run automatically, for instance in a CI environment. When `-Dpacktest.auto` is set, the game test server will start automatically with the loaded tests. The process will exit when all tests have finished with the exist code set to the number of failed tests. Setting `-Dpacktest.auto.annotations` will emit GitHub annotations for all test failures and resource load errors. The following example can be adapted into a GitHub action workflow. ```yaml on: env: # Make sure to update these links! TEST_FABRIC_SERVER: https://meta.fabricmc.net/v2/versions/loader/1.20.4/0.15.3/0.11.2/server/jar TEST_FABRIC_API: https://cdn.modrinth.com/data/P7dR8mSH/versions/JMCwDuki/fabric-api-0.92.0%2B1.20.4.jar TEST_PACKTEST: https://cdn.modrinth.com/data/XsKUhp45/versions/18smpIeE/packtest-1.6-mc1.20.4.jar jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' - name: Download and prepare files run: | curl -o server.jar $TEST_FABRIC_SERVER mkdir mods curl -o mods/fabric-api.jar $TEST_FABRIC_API curl -o mods/packtest.jar $TEST_PACKTEST mkdir -p world/datapacks cp -r datapack world/datapacks/datapack - name: Run tests run: | java -Xmx2G -Dpacktest.auto -Dpacktest.auto.annotations -jar server.jar nogui ``` ## Commands ### `fail` * `fail <text component>`: fails the current test and returns from the function ### `succeed` * `succeed`: always succeeds the current test and returns from the function ### `assert` * `assert <condition>`: if condition is unsuccessful, fails the current test and returns from the function * `assert not <condition>`: if condition is successful, fails the current test and returns from the function ### `await` * `await <condition>`: similar to assert, but keeps trying the condition every tick until the test times our or the condition succeeds * `await not <condition>`: keeps trying the condition until it fails * `await delay <time>`: waits for a specified time with unit ### Conditions * `block <pos> <block>`: checks if the block at the specified position matches the block predicate * `data ...`: checks NBT data using the same syntax as `execute if score` * `entity <selector>`: checks if the selector matches any entity (can also find entities outside the structure bounds) * `predicate <predicate>`: checks a predicate in a data pack * `score ...`: checks scores using the same syntax as `execute if score` * `chat <pattern> `: checks whether a chat message was sent in the past tick matching a regex pattern ## Dummies Fake players can be spawned using the `/dummy` command. Dummies won't save or load their data from disk, they will also not load their skin. * `dummy <name> spawn`: spawns a new dummy * `dummy <name> respawn`: respawns the dummy after it has been killed * `dummy <name> leave`: makes the dummy leave the server * `dummy <name> jump`: makes the dummy jump, if currently on ground * `dummy <name> sneak `: makes the dummy hold shift or un-shift (not the same as currently crouching) * `dummy <name> sprint `: makes the dummy sprint or un-sprint * `dummy <name> drop `: makes the dummy drop the current mainhand, either one item or the entire stack * `dummy <name> swap`: makes the dummy swap its mainhand and offhand * `dummy <name> selectslot`: makes the dummy select a different hotbar slot * `dummy <name> use item`: makes the dummy use its hand item, either mainhand or offhand * `dummy <name> use block <pos> `: makes the dummy use its hand item on a block positi
# PackTest PackTest allows you to write game tests in a data pack. Tests are `.mcfunction` files in a `test` folder. They can be used to test custom data packs.
## Example `data/example/test/foo.mcfunction` ```mcfunction #> Summons an armor stand and finds it # @template example:small_platform # @optional
summon armor_stand ~1. 5 ~1 ~1. 5 execute positioned ~1. 5 ~1 ~1. 5 run assert entity @e
assert predicate example:test
setblock ~1 ~1 ~1 grass_block execute if block ~1 ~1 ~1 stone run succeed
fail "Oh no" ```
### Async tests Test functions can be asynchronous, using the `await` keyword! ```mcfunction setblock ~ ~ ~ stone summon item ~ ~6 ~
await entity @e
await delay 1s
data merge entity @e {Motion: } ```
## Running tests
Tests can be run in-game using the `test` command.
`test runall`: runs all the tests
`test runall
### Auto test server Tests can also be run automatically, for instance in a CI environment. When `-Dpacktest.auto` is set, the game test server will start automatically with the loaded tests. The process will exit when all tests have finished with the exist code set to the number of failed tests.
Setting `-Dpacktest.auto.annotations` will emit GitHub annotations for all test failures and resource load errors.
The following example can be adapted into a GitHub action workflow. ```yaml on:
env: # Make sure to update these links! TEST_FABRIC_SERVER: https://meta.fabricmc.net/v2/versions/loader/1. 20. 4/0. 15. 3/0. 11. 2/server/jar TEST_FABRIC_API: https://cdn.modrinth.com/data/P7dR8mSH/versions/JMCwDuki/fabric-api-0. 92. 0%2B1. 20. 4.jar TEST_PACKTEST: https://cdn.modrinth.com/data/XsKUhp45/versions/18smpIeE/packtest-1. 6-mc1. 20. 4.jar
jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: distribution: 'temurin' java-version: '17' - name: Download and prepare files run: | curl -o server.jar $TEST_FABRIC_SERVER mkdir mods curl -o mods/fabric-api.jar $TEST_FABRIC_API curl -o mods/packtest.jar $TEST_PACKTEST mkdir -p world/datapacks cp -r datapack world/datapacks/datapack - name: Run tests run: | java -Xmx2G -Dpacktest.auto -Dpacktest.auto.annotations -jar server.jar nogui ```
## Commands
### `fail`
`fail
### `succeed` `succeed`: always succeeds the current test and returns from the function
### `assert`
`assert
### `await`
`await
### Conditions
`block
## Dummies Fake players can be spawned using the `/dummy` command. Dummies won't save or load their data from disk, they will also not load their skin.
`dummy
📊 Mod Details
- Game
- Minecraft Mods
- Author
- Misode
- Version
- 2.6.0
- Downloads
- 14,745
- Endorsements
- 21
- Category
- fabric
- Created
- 12/21/2023
- Updated
- 8/15/2026
- Game Versions
- 26.2
- Tags
- management, utility
🔧 How to Install Minecraft Mods Mods
Download from Modrinth. Use Prism Launcher or drop into your mods folder.
📖 Full step-by-step install guide for Minecraft Mods →
Visit the official mod page for specific installation instructions for this mod.
🎮 Need cheat codes or console commands? Check ur gaming wiki for Minecraft Mods commands, item IDs, and more.
❓ Frequently Asked Questions
Which Minecraft Mods versions does PackTest support?
The author lists 26.2. Other versions may work but are untested by the author.
What is the latest version of PackTest?
Version 2.6.0, published 2026-08-15 with 14,745 downloads recorded at the source.
Keep browsing — more Minecraft Mods mods await


