Debug Command Generator — /debug start, stop, function (Minecraft Profiler)
Run these from an operator’s chat, a command block, or a function file. Stopwatch and Fetchprofile are newer commands — check availability on your Minecraft version.
How to Use the Debug Command Generator
- Pick a mode: Start begins a profiling session, Stop ends it and writes a report, or Function traces one function (or an entire function tag) in a single pass.
- For Function mode, type the function’s resource location (e.g.
my_pack:main), or check “Function tag” to trace every function inside a tag instead of one function. - Copy the generated
/debugcommand into the console or an operator’s chat. - Remember Start must be followed by a later Stop – the profiler keeps recording server-wide performance data until you stop it.
Command Syntax Reference
/debug start /debug stop /debug function <name> /debug function #<tag>
/debug start begins the server’s built-in performance profiler, sampling tick timings across the whole server. /debug stop ends that session and writes a timing report (as both a raw text file and an interactive HTML report) into the world’s debug folder, along with the total elapsed ticks and real time. /debug function my_pack:main is different – instead of profiling everything, it runs that one function a single time and reports exactly how many commands it executed, which is the fastest way to sanity-check a function without digging through logs. Prefixing the argument with #, like /debug function #my_pack:all_tests, targets a function tag instead, tracing every function listed in that tag in one combined pass.
Frequently Asked Questions
What’s actually in the report after /debug stop?
It’s a tick-by-tick performance profile – a breakdown of where server time went (entity ticking, block ticking, network, etc.) over the sampled period – written to the world’s debug folder as both a plain-text summary and a browsable HTML flame-chart-style report.
How is /debug function different from just running /function?
Running /function directly just executes the function. /debug function executes it too, but additionally reports the exact number of commands run, which is useful for confirming a function actually did what you expected without manually counting output lines.
What does tracing a function tag do differently from tracing one function?
A function tag can list several unrelated functions under one name (e.g. every automated test in a pack). Tracing the tag with # runs and reports on all of them together in one pass instead of requiring a separate /debug function call per function.
Does /debug start/stop affect gameplay performance while it’s recording?
The profiler adds some sampling overhead while active, but it’s designed for exactly this kind of live diagnosis – it’s the standard first step server admins take when trying to find out what’s causing lag, rather than guessing from the outside.
Related Tools
- Tick Command Generator – check the tick rate and MSPT alongside a debug profile.
- Datapack Command Generator – manage the pack that owns the function you’re profiling.
- Test Command Generator – run structured GameTest suites instead of a single function trace.