Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
/debug

Command

/debug

Starts and stops a performance measurement of the game's ticks, or runs a function and writes down every command it executes.

Syntax

/debug function <name>
/debug (start|stop)

Arguments

ArgumentKind of valueWhat to type
<name>FunctionFor function: the id of the function to trace, or a function tag starting with #.

Details

Permission level3: server operators with level 3 or higher
Works inSingleplayer with cheats enabled and multiplayer servers. Needs permission level 3 (admins). Command blocks and functions run at level 2 and cannot use it.
Resultstart reports "Started tick profiling" and returns 0. stop reports how many seconds and ticks were measured and the average ticks per second, and returns the ticks per second as a whole number. function reports how many commands were traced and the name of the output file.
startBegins measuring. Fails with "The tick profiler is already started" if a measurement is running.
stopEnds the measurement and reports the result. Fails with "The tick profiler hasn't started" if none is running.
functionRuns the given function or function tag and writes a trace of every command, result, function call, message, and error to a text file named debug-trace- followed by the date and time, in the debug folder of the game or server directory.
Function limitsThe traced function runs with at most permission level 2. Tracing cannot be started from inside a function and cannot be combined with /return run.

Examples

/debug start

Starts measuring tick performance.

/debug stop

Stops measuring and shows the average ticks per second.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)