Minecraft Wiki
Advertisement
This article is about the command that runs time profiler and function trace. For the performance profiler, see Commands/perf. For the jvm profiler, see Commands/jfr. For other uses of "debug", see Debug.
Information icon
This feature is exclusive to Java Edition. 

Starts or stops a time profiler session. Gets more detailed information of function execution.

Syntax[]

debug start

Starts a new debug time profiler session.

debug stop

Stops the active debug time profiler session.

debug function <name>

Used the same way as /function to get more detailed information of commands' execution.

Arguments[]

<name>: function

It must be a resource location, which refers to a single function, or one prefixed with a #, which refers to a function tag.

Result[]

CommandTriggerJava Edition
/debug starta debug profiling session has already been started Failed
/debug stopthere's no debug profiling session running.
/debug functionthe specified functions or function tags do not exist
anyOtherwiseSuccessful

Output[]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn failN/A00
/debug startOn successN/A10
/debug stopOn successN/A1the average tps (ticks per second) during debug profiling
/debug functionOn successN/A1the number of commands executed (whether successfully or not) plus the number of embedded functions. See also Commands/function

File structure[]

Function trace[]

When using /debug function, a txt file titled debug-trace-yyyy-MM-dd_HH.mm.ss.txt is created in .minecraft/debug.

In this file,

  • [C] <command> means the <command> is executed.
  • [M] <message> means a message is returned.
  • [E] <message> means a failure message is returned.
  • [R = <num>] <command> means the <command> returns a brigadier return value.
  • [C] <command> -> <num> means the <command> is executed and returns a brigadier return value.
  • [F] <function> size=<num> means a function is called.

For most of commands, the brigadier return value is equal to the result value that can be stored with /execute store result.

But for /execute ... with one or more of the following subcommands, the brigadier return value is the number of times that the last subcommand is executed successfully:

  • ... if ... (not at the end)
  • ... unlesss ... (not at the end)
  • ... as <targets> ...
  • ... at <targets> ...
  • ... positioned as <targets> ...
  • ... totated as <targets> ...
  • ... facing entity <targets> <anchor> ...

Profile result[]

This section describes content that exists only in outdated versions of Minecraft. 
This feature used to be in the game, but has ever since been removed.It may or may not return in a future update.

When using /debug stop, a txt file titled profile-results-yyyy-MM-dd_HH.mm.ss.txt is created in .minecraft/debug, which includes the result of profile dump.

Report[]

This section describes content that exists only in outdated versions of Minecraft. 
This feature used to be in the game, but has ever since been removed.It may or may not return in a future update.

When using /debug report, a ZIP file is created with in .minecraft/debug/profiling the following structure:

  • debug-report-yyyy-MM-dd_HH.mm.ss.zip
    • levels
      • minecraft or <other custom namespaces>
        • overworld or the_end or the_nether or <other custom dimensions>
          • block_entities.csv: Contains a list of block entities in the world in the format x,y,z,type.
          • chunks.csv: Contains a list of chunk information in the format x,z,level,in_memory,status,full_status,accessible_ready,ticking_ready,entity_ticking_ready,ticket,spawning,entity_count,block_entity_count.
          • entities.csv: Contains a list of entities in the world in the format x,y,z,uuid,type,alive,custom_name.
          • example_crash.txt: An example crash file.
          • stats.txt: Contains some stats.
    • classpath.txt: Contains the file paths of the external jars Minecraft uses.
    • example_crash.txt: An example crash file.
    • gamerules.txt: A plain text file containing a list of game rules and their values (<gamerule>=<value>).
    • stats.txt: Contains some stats.
    • threads.txt: All running threads.

History[]

Java Edition
1.3.112w27aAdded /debug.
1.814w31a/debug can now be run in single-player.
Added /debug chunk.
1.8.1pre1Removed /debug chunk.
1.1318w03aAdded commands to the profiler.
1.14.4pre1Added /debug report, used to get more detailed information while debugging performance.
1.1721w15aAdded /debug function
Pre-release 1Removed /debug report. Replaced by F3+L and /perf.
Advertisement