Data Generators

Data Generators are a tool added in 1.13 that can export reports about various parts of the game, and additionally are used internally by Mojang to generate various json files.

Command line
The main entry point for data generators is  instead of   or. This is present on both the client and the server, but since the server includes all needed libraries to run it while the client has them in separate jars, it is much easier to use the server. Since this isn't the main class, the game must be ran using a different command line than normal:

java -cp minecraft_server.jar net.minecraft.data.Main

There are several arguments:


 * --help
 * Show the help menu (same as running with no arguments)


 * --input
 * Specify an input folder for the converters. Can be specified multiple times, as in.


 * --output
 * Output folder (defaults to )


 * --client
 * --dev
 * --reports
 * --server
 * Specifies which generators to run; see the table below.


 * --all
 * Same as.

Generators
There are several different generators, which are controlled via the arguments above.

Blocks report
A report that contains all block states in the global palette. Notably, this contains numeric IDs as used on the protocol, so it can be used to get the proper IDs for a version. The report is saved in.

A few sample entries:

The key of the object is the block ID. Within it, the  tag contains all properties within the state, where the key within that is the property name and the value is an array of allowed property values. This tag will not be present if there are no properties. The  tag is a list of different states for the block. Within each state, the  tag maps each property to the value on that state (which, again, will not be present if there are no properties); the   tag gives the numeric state ID (as used over the network); and the   tag indicates if the state is the default one for the block (there should be only one such state).

This report does not contain numeric block IDs, only state IDs. Block IDs only remain in use on the Block Action packet; they can be inferred by the position in the report.

Items report
The items report contains a list of all items, and their network IDs.

Note that item IDs are no longer related to block IDs or block state IDs. They all start out in the same sequence, but some blocks do not have items and items do not include block states (by design).

Registries report
Contains IDs from all registries, including block and item IDs.

The key within the root object is the registry's own ID, and the  there is the ID for the registry over the network (is this used?). indicates a default value to be used when one is needed or an unknown value is used. is the actual content of the registry; keys in it are the name of the element and  is the actual relevant ID.

The different registries:

Commands report
This report contains the Command Graph. The format matches information described in that article, except that  is the key for an object, and suggestions are not present in the report.

NBT converters
There are two NBT-related data generators. One converts "SNBT" (stringified NBT - the same NBT format used in commands) to NBT; the other converts NBT into SNBT. Both look for files of the appropriate extension ( or  ) in the input folder(s), and output them at the same relative location in the output folder.

Tag providers
The tag providers are used to create tag JSON files based off of data stored in code. As such, they aren't directly useful to people who are not writing mods. They can be used by subclassing, overriding the appropriate methods, and changing the data within.

Advancement provider
The advancement provider is used to generate advancement JSON files based off of data stored in code. It works off of nested consumers, where one layer of consumers contains the actual data (split between the different advancement categories), and that consumer takes a consumer that is actually responsible for saving the advancement. It can be used by subclassing only.

Recipes provider
The recipe JSON file creates recipes based on data in code. It can't be used directly.