Skip to content

Meeples10/MCResourceAnalyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minecraft Resource Analyzer

MCResourceAnalyzer gathers data from Minecraft region files to determine the empirical distribution of naturally-occurring block types. For more information, see this page.

Using the program

  1. Clone the repository and build it with Maven or download the latest release here.
  2. If your world was generated with a version after Beta 1.3, use the region directory from your Minecraft world as the program's input. If the world was generated with a version between Infdev 20100327 and Beta 1.2, use the entire world directory as the input. If the world was generated with Indev, use the world.mclevel file as the input.
  3. Run the program with java -jar mc-resource-analyzer-x.x.x.jar [options...] [input path]. After analyzing the world, the program will create a file in the same directory named data.csv.

Note that the numbers for minecraft:air may be inaccurate at high Y values due to the way Minecraft stores chunks.

Command line arguments

java -jar mc-resource-analyzer-x.x.x.jar [-hjmsStV] [-B=PATH] [-M=PATH] [-o=STRING] [-T=PATH] [-v=VERSION] [INPUT]

Positional arguments

  • INPUT (default: region): The to the region directory or .mclevel file to analyze. Both relative and absolute paths are supported.

Options and flags

  • -h, --help: Show usage help.
  • -t, --table: Generates a simple HTML table with the collected data.
  • -T, --table-template: When used in conjunction with table, the generated table will replace any instances of the string {{{TABLE}}} in a copy of the template file. Note that the table will not include <table></table> tags when using this argument.
  • -s, --statistics: Outputs a file with statistics about the analysis.
  • -j, --json: Outputs a JSON file with containing the counts of each block.
  • -o, --output-prefix: Use this argument to add a prefix to the program's output files. For example, using -o abc would result in the files abc.csv and abc_table.html.
  • -v, --version-select: Use this argument if you want to analyze a world that was not generated with the latest version of Minecraft. Selecting a version that does not match the version with which the regions were generated may result in unexpected behavior. The following versions are supported:
    • ANVIL_118 for 1.18 to 1.20.4 (default)
    • ANVIL_2021 for 1.16 to 1.17
    • ANVIL_2018 for 1.13 to 1.15
    • ANVIL_2012 for 1.2 to 1.12
    • MCREGION for Beta 1.3 to 1.1
    • ALPHA for Infdev 20100327 to Beta 1.2
    • INDEV for Indev 0.31 20100122 to Infdev 20100325
  • -m, --modernize-ids: If analyzing regions saved before 1.13, numeric block IDs will be replaced with their modern string representations. If no string corresponding to the numeric ID is found, the numeric ID will be saved instead.
  • -B, --block-ids: When using the --modernize-ids option on a world with block IDs outside the range of 0-255, use this to specify the path to a file containing block IDs in the same format as blocks.properties.
  • -M, --merge-ids: When analyzing a world with block IDs outside the range of 0-255, use this to specify the path to a file containing block IDs in the same format as merge.properties. Any block with an ID listed in this file will have all of its variants merged into a single value.
  • -n, --num-threads (default: 8): The maximum number of threads to use for analysis.
  • -S, --silent: Prevents the program from printing output, other than errors. This may result in marginally improved performance.

Version compatibility

MCResourceAnalyzer 1.2.4 can analyze worlds generated with any version of Minecraft: Java Edition between Indev 0.31 20100122 and 1.20.4.

Note that Indev worlds with the Long and Deep world shapes are not supported.

Contributing

Contributions to this project are more than welcome. If you fork MCResourceAnalyzer, please include the following URL somewhere in your fork: https://github.com/Meeples10/MCResourceAnalyzer

If you notice that MCResourceAnalyzer fails to analyze a particular world, please create an issue with the version of Minecraft with which the world was generated, the output of the program, and, if possible, the region file that caused the failure.