Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/debug: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Remove broken links to missing pages
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
 
Line 1: Line 1:
{{about|the command that runs time profiler and function trace|the performance profiler|Commands/perf|the jvm profiler|Commands/jfr|other uses of "debug"|Debug}}
{{about|the command that runs time profiler and function trace|the performance profiler|Commands/perf|the jvm profiler|Commands/jfr|other uses of "debug"|Debug}}
{{exclusive|java}}
{{MC/Exclusive|java}}
{{Infobox command
{{Infobox command
|name=debug
|name=debug
Line 14: Line 14:
: Stops the active debug time profiler session.
: Stops the active debug time profiler session.
<code>debug function <name></code>
<code>debug function <name></code>
: Used the same way as [[Minecraft:Commands/function|/function]] to get more detailed information of commands' execution. Could not be called directly or indirectly by {{cmd|return run}} or another {{cmd|debug function}}.
: Used the same way as [[Minecraft:Commands/function|/function]] to get more detailed information of commands' execution. Could not be called directly or indirectly by {{MC/Cmd|return run}} or another {{MC/Cmd|debug function}}.


== Arguments ==
== Arguments ==
{{argument|name|function}}
{{MC/Argument|name|function}}
: {{arg desc|je=function}}
: {{MC/Arg desc|je=function}}


== Result ==
== Result ==
Line 26: Line 26:
{{Result table|cmd=/debug stop|There's no debug profiling session running.}}
{{Result table|cmd=/debug stop|There's no debug profiling session running.}}
{{Result table|cmd=/debug function|The specified functions or function tags do not exist.}}
{{Result table|cmd=/debug function|The specified functions or function tags do not exist.}}
{{Result table|cmd=/debug function|This command execution is caused by {{cmd|return run}} or another {{cmd|debug function}}.}}
{{Result table|cmd=/debug function|This command execution is caused by {{MC/Cmd|return run}} or another {{MC/Cmd|debug function}}.}}
{{Result table|cmd=|succeed}}
{{Result table|cmd=|succeed}}
{{Result table}}
{{Result table}}


== Output ==
== Output ==
{{Output table}}
{{MC/Output table}}
{{Output table|edition=je|On fail|N/A|0|0}}
{{MC/Output table|edition=je|On fail|N/A|0|0}}
{{Output table|cmd=/debug start|On success|N/A|1|0}}
{{MC/Output table|cmd=/debug start|On success|N/A|1|0}}
{{Output table|cmd=/debug stop|On success|N/A|1|the average tps (ticks per second) during debug profiling}}
{{MC/Output table|cmd=/debug stop|On success|N/A|1|the average tps (ticks per second) during debug profiling}}
{{Output table|cmd=/debug function|On success|N/A|1|the total number of commands in the functions}}
{{MC/Output table|cmd=/debug function|On success|N/A|1|the total number of commands in the functions}}
{{Output table}}
{{MC/Output table}}


== File structure ==
== File structure ==
=== Function trace ===
=== Function trace ===
When using {{cmd|debug function|link=none}}, a txt file titled '''debug-trace-yyyy-MM-dd_HH.mm.ss.txt''' is created in <samp>.minecraft/debug</samp>.
When using {{MC/Cmd|debug function|link=none}}, a txt file titled '''debug-trace-yyyy-MM-dd_HH.mm.ss.txt''' is created in <samp>.minecraft/debug</samp>.


In this file,
In this file,
Line 65: Line 65:
=== Profile result ===
=== Profile result ===
{{Outdated feature|section=1}}
{{Outdated feature|section=1}}
When using {{cmd|debug stop|link=none}}, a txt file titled '''profile-results-yyyy-MM-dd_HH.mm.ss.txt''' is created in <samp>.minecraft/debug</samp>, which includes the result of profile dump.
When using {{MC/Cmd|debug stop|link=none}}, a txt file titled '''profile-results-yyyy-MM-dd_HH.mm.ss.txt''' is created in <samp>.minecraft/debug</samp>, which includes the result of profile dump.
=== Report ===
=== Report ===
{{Outdated feature|section=1}}
{{Outdated feature|section=1}}
When using {{cmd|debug report|link=none}}, a ZIP file is created with in <samp>.minecraft/debug/profiling</samp> the following structure:
When using {{MC/Cmd|debug report|link=none}}, a ZIP file is created with in <samp>.minecraft/debug/profiling</samp> the following structure:
<div class=treeview>
<div class=treeview>
* '''debug-report-yyyy-MM-dd_HH.mm.ss.zip'''
* '''debug-report-yyyy-MM-dd_HH.mm.ss.zip'''
Line 75: Line 75:
**** '''overworld''' or '''the_end''' or '''the_nether''' or '''<other custom dimensions>'''
**** '''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 <code>x,y,z,type</code>.
***** '''block_entities.csv''': Contains a list of block entities in the world in the format <code>x,y,z,type</code>.
***** '''chunks.csv''': Contains a list of chunk information in the format {{cd|x,z,level,in_memory,status,full_status,accessible_ready,ticking_ready,entity_ticking_ready,ticket,spawning,entity_count,block_entity_count}}.
***** '''chunks.csv''': Contains a list of chunk information in the format {{MC/Cd|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 {{cd|x,y,z,uuid,type,alive,custom_name}}.
***** '''entities.csv''': Contains a list of entities in the world in the format {{MC/Cd|x,y,z,uuid,type,alive,custom_name}}.
***** '''example_crash.txt''': An example crash file.
***** '''example_crash.txt''': An example crash file.
***** '''stats.txt''': Contains some stats.
***** '''stats.txt''': Contains some stats.
Line 88: Line 88:
== History ==
== History ==
{{HistoryTable
{{HistoryTable
|{{HistoryLine|java}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||1.3.1|dev=12w27a|Added {{cmd|debug|link=none}}.}}
|{{HistoryLine||1.3.1|dev=12w27a|Added {{MC/Cmd|debug|link=none}}.}}
|{{HistoryLine||1.8|dev=14w31a|{{cmd|debug|link=none}} can now be run in single-player.
|{{HistoryLine||1.8|dev=14w31a|{{MC/Cmd|debug|link=none}} can now be run in single-player.
|Added {{cmd|debug chunk|link=none}}.}}
|Added {{MC/Cmd|debug chunk|link=none}}.}}
|{{HistoryLine||1.8.1|dev=pre1|Removed {{cmd|debug chunk|link=none}}.}}
|{{HistoryLine||1.8.1|dev=pre1|Removed {{MC/Cmd|debug chunk|link=none}}.}}
|{{HistoryLine||1.13|dev=18w03a|Added commands to the profiler.}}
|{{MC/HistoryLine||1.13|dev=18w03a|Added commands to the profiler.}}
|{{HistoryLine||1.14.4|dev=pre1|Added {{cmd|debug report|link=none}}, used to get more detailed information while debugging performance.}}
|{{HistoryLine||1.14.4|dev=pre1|Added {{MC/Cmd|debug report|link=none}}, used to get more detailed information while debugging performance.}}
|{{HistoryLine||1.17|dev=21w15a|Added {{cmd|debug function|link=none}}.}}
|{{HistoryLine||1.17|dev=21w15a|Added {{MC/Cmd|debug function|link=none}}.}}
|{{HistoryLine|||dev=Pre-release 1|Removed {{cmd|debug report|link=none}}. Replaced by F3+L and {{cmd|perf|link=none}}.}}
|{{HistoryLine|||dev=Pre-release 1|Removed {{MC/Cmd|debug report|link=none}}. Replaced by F3+L and {{MC/Cmd|perf|link=none}}.}}
|{{HistoryLine||1.20.3|dev=23w41a|Now the result value of {{cmd|debug function|link=none}} is the total number of commands in the functions.
|{{HistoryLine||1.20.3|dev=23w41a|Now the result value of {{MC/Cmd|debug function|link=none}} is the total number of commands in the functions.
|Now {{cmd|debug function|link=none}} cannot be called by {{cmd|debug function|link=none}}.}}
|Now {{MC/Cmd|debug function|link=none}} cannot be called by {{MC/Cmd|debug function|link=none}}.}}
|{{HistoryLine|||dev=23w44a|Now {{cmd|debug function|link=none}} cannot be called by {{cmd|return run}}.}}
|{{HistoryLine|||dev=23w44a|Now {{MC/Cmd|debug function|link=none}} cannot be called by {{MC/Cmd|return run}}.}}
}}
}}


== Navigation ==
== Navigation ==
{{Navbox commands}}
{{MC/Navbox commands}}


de:Befehl/debug
de:Befehl/debug

Latest revision as of 20:09, 9 April 2026

Script error: No such module "Exclusive". Template:Infobox command

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. Could not be called directly or indirectly by
  1. REDIRECT Template:Command

Template:Redr or another

  1. REDIRECT Template:Command

Template:Redr.

Arguments

<name>: function

{{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|function}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}

Result

Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table

Output

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|N/A}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|N/A}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/debug start}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|N/A}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the average tps (ticks per second) during debug profiling}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/debug stop}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|N/A}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the total number of commands in the functions}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/debug function}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}

{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}

File structure

Function trace

When using

  1. REDIRECT Template:Command

Template:Redr, 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 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, each branch returns its success value as its brigadier return value:

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

Some commands like /return and /function have no brigadier return value.

Profile result

Template:Outdated feature When using

  1. REDIRECT Template:Command

Template:Redr, 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

Template:Outdated feature When using

  1. REDIRECT Template:Command

Template:Redr, 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
  1. REDIRECT Template:Code

Template:Redr.

          • entities.csv: Contains a list of entities in the world in the format
  1. REDIRECT Template:Code

Template:Redr.

          • 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

Template:HistoryTable

Navigation

All editions
Removed
Template:El only
Debug
Removed
Template:Els only
Template:El only
Removed
Template:El only
Removed
Template:Els only
Removed
Joke
Related

de:Befehl/debug ja:コマンド/debug pt:Comandos/debug ru:Команды консоли/debug zh:命令/debug