Minecraft:Commands/debug: Difference between revisions
More actions
Fix template calls: add MC/ prefix |
Sync: updated from Minecraft |
||
| 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}} | ||
{{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 | : Used the same way as {{cmd|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}}. | ||
== Arguments == | == Arguments == | ||
{{ | {{argument|name|function}} | ||
: {{ | : {{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 {{ | {{Result table|cmd=/debug function|This command execution is caused by {{cmd|return run}} or another {{cmd|debug function}}.}} | ||
{{Result table|cmd=|succeed}} | {{Result table|cmd=|succeed}} | ||
{{Result table}} | {{Result table}} | ||
== Output == | == Output == | ||
{{ | {{Output table}} | ||
{{ | {{Output table|edition=je|On fail|N/A|0|0}} | ||
{{ | {{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}} | ||
{{ | {{Output table|cmd=/debug function|On success|N/A|1|the total number of commands in the functions}} | ||
{{ | {{Output table}} | ||
== File structure == | == File structure == | ||
=== Function trace === | === Function trace === | ||
When using {{ | 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>. | ||
In this file, | In this file, | ||
| Line 65: | Line 65: | ||
=== Profile result === | === Profile result === | ||
{{Outdated feature|section=1}} | {{Outdated feature|section=1}} | ||
When using {{ | 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. | ||
=== Report === | === Report === | ||
{{Outdated feature|section=1}} | {{Outdated feature|section=1}} | ||
When using {{ | When using {{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 74: | Line 74: | ||
*** '''minecraft''' or '''<other custom namespaces>''' | *** '''minecraft''' or '''<other custom namespaces>''' | ||
**** '''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 [[Minecraft: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 {{ | ***** '''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}}. | ||
***** '''entities.csv''': Contains a list of entities in the world in the format {{ | ***** '''entities.csv''': Contains a list of [[Minecraft:entities]] in the world in the format {{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. | ||
** '''classpath.txt''': Contains the file paths of the external jars ''Minecraft'' uses. | ** '''classpath.txt''': Contains the file paths of the external jars ''Minecraft'' uses. | ||
** '''example_crash.txt''': An example crash file. | ** '''example_crash.txt''': An example crash file. | ||
** '''gamerules.txt''': A plain text file containing a list of game | ** '''gamerules.txt''': A plain text file containing a list of [[Minecraft:game rule]]s and their values (<code><gamerule>=<value></code>). | ||
** '''stats.txt''': Contains some stats. | ** '''stats.txt''': Contains some stats. | ||
** '''threads.txt''': All running threads. | ** '''threads.txt''': All running threads. | ||
| Line 88: | Line 88: | ||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{ | |{{HistoryLine|java}} | ||
|{{HistoryLine||1.3.1|dev=12w27a|Added {{ | |{{HistoryLine||1.3.1|dev=12w27a|Added {{cmd|debug|link=none}}.}} | ||
|{{HistoryLine||1.8|dev=14w31a|{{ | |{{HistoryLine||1.8|dev=14w31a|{{cmd|debug|link=none}} can now be run in single-player. | ||
|Added {{ | |Added {{cmd|debug chunk|link=none}}.}} | ||
|{{HistoryLine||1.8.1|dev=pre1|Removed {{ | |{{HistoryLine||1.8.1|dev=pre1|Removed {{cmd|debug chunk|link=none}}.}} | ||
|{{ | |{{HistoryLine||1.13|dev=18w03a|Added commands to the profiler.}} | ||
|{{HistoryLine||1.14.4|dev=pre1|Added {{ | |{{HistoryLine||1.14.4|dev=pre1|Added {{cmd|debug report|link=none}}, used to get more detailed information while debugging performance.}} | ||
|{{HistoryLine||1.17|dev=21w15a|Added {{ | |{{HistoryLine||1.17|dev=21w15a|Added {{cmd|debug function|link=none}}.}} | ||
|{{HistoryLine|||dev=Pre-release 1|Removed {{ | |{{HistoryLine|||dev=Pre-release 1|Removed {{cmd|debug report|link=none}}. Replaced by F3+L and {{cmd|perf|link=none}}.}} | ||
|{{HistoryLine||1.20.3|dev=23w41a|Now the result value of {{ | |{{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. | ||
|Now {{ | |Now {{cmd|debug function|link=none}} cannot be called by {{cmd|debug function|link=none}}.}} | ||
|{{HistoryLine|||dev=23w44a|Now {{ | |{{HistoryLine|||dev=23w44a|Now {{cmd|debug function|link=none}} cannot be called by {{cmd|return run}}.}} | ||
}} | }} | ||
== Navigation == | == Navigation == | ||
{{ | {{Navbox commands}} | ||
de:Befehl/debug | [[Minecraft:de:Befehl/debug]] | ||
ja:コマンド/debug | [[Minecraft:ja:コマンド/debug]] | ||
pt:Comandos/debug | [[Minecraft:pt:Comandos/debug]] | ||
ru:Команды консоли/debug | [[Minecraft:ru:Команды консоли/debug]] | ||
zh:命令/debug | [[Minecraft:zh:命令/debug]] | ||
Latest revision as of 11:13, 7 August 2026
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Template: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 Template:Cmd to get more detailed information of commands' execution. Could not be called directly or indirectly by Template:Cmd or another Template:Cmd.
Arguments
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
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
File structure
Function trace
When using Template:Cmd, 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 Template:Cmd, 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 Template:Cmd, 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 Minecraft:block entities in the world in the format
x,y,z,type. - chunks.csv: Contains a list of chunk information in the format Template:Cd.
- entities.csv: Contains a list of Minecraft:entities in the world in the format Template:Cd.
- example_crash.txt: An example crash file.
- stats.txt: Contains some stats.
- block_entities.csv: Contains a list of Minecraft:block entities in the world in the format
- overworld or the_end or the_nether or <other custom dimensions>
- minecraft or <other custom namespaces>
- 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 Minecraft:game rules and their values (
<gamerule>=<value>). - stats.txt: Contains some stats.
- threads.txt: All running threads.
- levels
History
Minecraft:de:Befehl/debug Minecraft:ja:コマンド/debug Minecraft:pt:Comandos/debug Minecraft:ru:Команды консоли/debug Minecraft:zh:命令/debug