Tutorials/Running the data generator

This tutorial shows how to run the data generator that is included $$ client and server distributions since 1.13.

Purpose
The data generator can:
 * Convert G-Zip compressed NBT format files with .nbt extensions (as used in Structure files) from and to String NBT format files with .snbt extensions.
 * Generate all contents of the vanilla data pack
 * Create JSON reports of all block states, all registries, and the full vanilla command tree

Getting Started
To launch the data generator, it is recommended that you download the official server distribution of the Minecraft version you desire.

Then, open a bash or command prompt in the directory where you have the server jar, and run (make sure you have Java installed)

If you have set up correctly, the command line will show a list of options and descriptions.

Generating data pack contents
In the same command line interface, run

The contents of the vanilla data pack (except pack.mcmeta ) will be generated to generated directory in the run directory of the command line interface.

Generating stringified server DAT files
Many of the server data files located in the world directory of the game server bear the  extension. Many of these files are actually saved in Named Binary Tag (NBT) format used widely throughout Minecraft. Follow these steps to use the data generator tools distributed with the Minecraft server JAR to convert these files to a human-readable "stringified" format:


 * 1) Open a terminal or command prompt of your choice on your game server
 * 2) Create a new directory named  in the same directory as your game server JAR
 * 3) Copy any qualifying  file which is actually written in NBT format into the   directory you created and re-save it with the   extension
 * 4) Use the  flag to activate the development generator which is capable of converting a directory of NBT files into a directory of "stringified" NBT (SNBT) files If it worked, you'll get some output that looks like this You should also have a new directory named   in the current directory where you ran the command.  Inside will be the stringified version of each file you supplied as input.
 * 5) Use command-line tools of your choice (e.g.  on linux systems) to view them immediately, or use a GUI text editor of your choice to open them

Stringify all DAT files:
If you'd like to stringify every DAT file currently on your server (for experimentation, curiosity, or whatever):

For Linux:


 * 1) Start from the same directory where your  directory is located, then run this command to recursively copy all the DAT files into it . Replace   with the relative path to the directory holding the world data in your game server.  By default, Minecraft creates this directory in the same directory as the server JAR, and names it  .  Unless you've changed the world name in   or moved this directory somewhere else, you can probably just replace that entire path with  
 * 2) Rename all of these files with the  extension :
 * 3) Re-run the data generator with the  flag as described above in step 4 under "Generating stringified server DAT files".

For Windows:


 * 1) Start from the same directory where your   directory is located, then run this command to copy all files in the save's folder with the .dat extension into the input folder, replacing .dat with .nbt. Replace   with the relative path to the directory holding the world data in your game server.  By default, Minecraft creates this directory in the same directory as the server JAR, and names it  .  Unless you've changed the world name in   or moved this directory somewhere else, you can probably just replace that entire path with  
 * 2) Re-run the data generator with the  flag as described above in step 4 under "Generating stringified server DAT files".