Material Counter is a datapack that lets you quickly calculate which materials and how many of each are required to recreate a selected structure in Minecraft.
Simply select an area using the dedicated Material Counter Position Selector, and the datapack will automatically analyze every block and generate a complete list of the required materials.
You can get the tool in two ways.

/trigger give
Go to one corner of your build and right-click an empty block face.
The Position Selector will change its appearance, indicating that the next step is selecting Position 2.
Go to the opposite corner of the build and right-click again.
The datapack will analyze every block inside the selected area.
Large selections may take longer depending on the size of the build and your computer's performance.
By default, the material list appears in chat.
If you prefer, you can switch to Book Mode, which generates a book containing the complete material list.
The datapack includes two optional settings.
/trigger listSwitches between:
/trigger position_outlinesEnables or disables the particles that mark Position 1 and Position 2.
Enabled by default.
The first time you join a world with the datapack installed, you'll automatically receive an in-game User Guide explaining every feature.
If you lose it, you can craft another copy using its crafting recipe.
No additional mods or libraries are required.
Place the datapack in your world's datapacks folder.
To enable the custom textures for the Position Selector, place the same ZIP file in the
resourcepacksfolder as well.
Selecting extremely large areas may cause Minecraft to freeze or crash.
Your world should remain safe, as Minecraft Java Edition can restore backups if a crash occurs during datapack execution.
Creator: MrKazanek
Special thanks: Bluezers
Thank you to everyone who supported this project! ❤️