How to Use the JFR Command – Wiki Guide
This Minecraft tutorial explains how to use the /jfr command with screenshots and step-by-step instructions.
The /jfr command allows you to start JFR profiling your Minecraft session by creating a JFR file. This file contains diagnostic and profiling data about a running Java application which, in this case, is Minecraft Java Edition. The JFR file must be opened by special software such as Java Flight Recorder by Oracle (there may be other tools that you can use to open the JFR file as well). Let’s explore how to use this cheat (game command).
Requirements
To run game commands in Minecraft, you have to turn cheats on in your world.
JFR Command
JFR Command in Minecraft Java Edition (PC/Mac)
In Minecraft Java Edition (PC/Mac), there are different syntaxes depending on whether you would like to start or stop the JFR profiling process.
To start the JFR profiling process:
/jfr start
To stop the JFR profiling process:
/jfr stop
Where is the JFR File Stored in Java Edition?
Depending on your version of Minecraft Java Edition, the JFR file would be be saved under one of the following hidden paths (Note: path may be different on your system):
Path for Windows
C:\Users\<username>\AppData\Roaming\.minecraft\debug\
Path for Mac
/Users/<username>/Library/Application Support/minecraft/debug/
How to Enter the Command
1. Open the Chat Window
The easiest way to run a command in Minecraft is within the chat window. The game control to open the chat window depends on the version of Minecraft:
- For Java Edition (PC/Mac), press the T key to open the chat window.
2. Type the Command
We will cover examples of how to both start and stop the JFR profiling process.
Start JFR Profiling
To start the JFR profilling process, you can enter the following command:
/jfr start
This command will start the process of recording the data for the running Minecraft Java program.
You will see the message “JFR profiling started” appear in the lower left corner of the game window.
Stop JFR Profiling
When you are finished and want to stop the JFR profiling process, you can enter the following command:
/jfr stop
Now the JFR profiling will be stopped and the JFR file will be dumped and saved.
You will see the message “JFR profiling stopped and dumped to debug/<filename>.jfr” appear in the lower left corner of the game window. Note that the last part of the message contains the filename of the JFR file that was created in the debug
folder. In this tutorial, the JFR file was called client-2021-11-28-082945.jfr
.
Each time you run these commands, a new JFR file will be created in the debug
folder. You can then use a program such as Java Flight Recorder by Oracle (or similar program) to open and analyze the contents of the JFR file.
Congratulations, you just learned how to use the /jfr command in Minecraft!