Generate mappings from PaperMC's Material to Minecraft sprite components.
You can download pre-generated mappings for a specific Minecraft version from the releases.
Some sprite names change across versions, new sprites are added for new materials, and existing sprites could be improved.
Notable changes include the refactoring of item sprites from the blocks (default) atlas to their dedicated items atlas, in Minecraft 1.21.11.
Clone the repository and build the JAR using Maven (be sure to checkout the tag corresponding to the version you're interested in so you get the correct mapping rules).
Run a PaperMC server with the appropriate version and the installed plugin. You should get the generated mappings in the plugin's folder.
You can also optionally customize the config.yml file to edit generation options, or the Java template file.
Naive approaches like using the material name or ID as a sprite key won't work for most of them.
Sprites are defined from atlases, which are automatically generated by the game based on textures in the resource pack.
You can visualize them by saving debug textures using F3 + S in-game.
This project relies on manually written mappings, that are used to transform material IDs and check for the existence of a sprite with that transformed key. You can help improve the results either by improving the mapping rules, or add "exceptions", which are basically exact matching rules to handle one or a few given materials only. Some materials don't have any sprite available, because the game does not provide them. Such materials were assigned manually selected head textures for completeness.
This project is licensed under the terms of the MIT license.