How to Test a Datapack in Multiplayer Before You Share It
Testing a datapack alone in singleplayer only tells you half the story. On a server, several players run your functions at the same time, people join halfway through, and chunks unload when nobody is near them. Those are the cases that break packs after release. Here's how to test for them.
.zip in world/datapacks on a server, then run /minecraft:reload (on Paper) and /datapack list. Read the server log for loading errors. Then test with at least two players: joins mid-game, deaths, logouts, restarts, and other dimensions. Check tick cost with /tick query or spark.Step 1: Load the pack on a server
- Upload the pack
.zipintoworld/datapacks/(or the folder named inlevel-name). Don't unzip it. - On Paper, run
/minecraft:reload. On vanilla,/reloaddoes the same job. - Run
/datapack list. Your pack should be in the enabled list.
If it isn't there, open the server log. A broken JSON file, a bad function line or a missing file shows up as an error when the pack loads, and singleplayer often hides these behind a generic warning screen. Our guide to server logs and latest.log shows where to look.
Also check pack.mcmeta. If its format number doesn't match the server's version, the game flags the pack as made for a different version and it may not enable.
Step 2: Fix the selectors before anything else
Most multiplayer bugs come from selectors that only work with one player.
@pin tick functions. A function in the#minecraft:ticktag runs as the server, at world spawn.@pthen picks whoever is nearest spawn, not "the player".@swith no executor. In a tick function,@smatches nothing.- The fix: loop over players with
execute as @a at @s run function yourpack:player_tick. Inside that function,@sis each player in turn.
Also check scoreboards. Per-player scores are fine. A single fake-player score like #timer is shared, so two players triggering the same thing can overwrite each other.
Step 3: Run a real multiplayer test
Get at least one other person on the server and go through this list:
- Two players trigger the same thing at once. Do both get the result, or only one?
- A player joins after the event started. Do they get set up correctly? Packs often need an advancement or a scoreboard check to catch new joiners.
- A player dies, respawns and changes dimension. Do tags and scores survive what they should?
- A player logs out in the middle of something. Does the pack clean up, or leave a stuck entity or a frozen timer?
- The server restarts. Scoreboards and storage are saved with the world, but anything that relied on an entity in an unloaded chunk might not come back.
- Nobody is near your machine. Chunks only run when they're loaded. If the pack depends on a fixed area, use
/forceload addfor it, and test what happens when everyone walks away.
Step 4: Check how much tick time it costs
A pack that's fine with one player can get heavy with ten.
/tick queryshows how long ticks take on average./tick freezeand/tick steplet you pause the game and step forward one tick at a time, which is great for watching a function chain.- On Paper, a spark profile shows which functions use the most time. See how to check your TPS and MSPT for what the numbers mean.
A common cause of lag is running heavy execute as @e checks every tick. Target a tag (@e[tag=yourpack_marker]) or run expensive checks every few ticks with schedule.
Paper vs vanilla for testing
Paper runs datapacks like vanilla in almost every case, and most players will run your pack on Paper anyway. But Paper does change a few vanilla mechanics, mostly bug fixes and duplication fixes, and some settings are different. If your pack depends on an exact vanilla quirk, do a final check on a vanilla server too.
Where to run the test
You can run a Paper server on your own PC, but then your testers need a way to reach it. If they're not on your Wi-Fi, that usually means port forwarding or a tool like Tailscale.
Another option is a free 14-day trial server from FreaksMC. You get a 4 GB Paper server with your own address, so testers just type it in and join. Bedrock crossplay is set up too, which is handy if you want to see how your pack behaves for Bedrock players. It needs no card. Keep in mind it's one trial per person, someone has to join within 12 hours of claiming it, slots are limited, and the files are deleted 2 days after it ends. Keep your pack's source on your own PC, not only on the server.
New to datapacks on servers? Start with how to add datapacks to a Minecraft server.
FAQ
Why does my datapack work in singleplayer but not on my server?
Usually a selector problem. In singleplayer @p always finds you. On a server, functions run from a tick tag have no player context, so @p and @s may pick the wrong player or nobody. Use @a with execute as @a at @s instead.
Should I use /reload on Paper?
Use /minecraft:reload. On Paper, plain /reload is the Bukkit command that also reloads plugins, which is not recommended. /minecraft:reload only reloads datapacks.
Want a server that just runs fast?
FreaksMC servers run on AMD Ryzen 9 7950X3D processors with fast NVMe storage. Pick vanilla, Paper or a modpack and your server is ready in minutes.
See plans from $4/mo