* Upvote this comment if this is a good quality post that fits the purpose of r/Minecraft
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
----
(*Vote has already ended*)
MordorsElite2026-01-20 00:53
Do you mean total?
It's tracking all the blocks placed individually already. (It's the "used" statistic for any placeable item)
TheGaming_1012026-01-20 00:55
Yeah
MordorsElite2026-01-20 01:38
Had the same question some time ago. So I wrote a python script that added up all the values for blocks:
```
import json
def load_stats(file_path:str) -> dict:
with open(file_path, 'r') as infile:
stats = json.load(infile)
return stats
def load_list_of_blocks(file_path:str) -> list:
with open(file_path, 'r') as infile:
block_list = json.load(infile)
blocks = list()
for block_type in block_list:
variants = block_type['variants']
if not isinstance(variants, list):
variants = [variants]
for variant in variants:
block = str.lower(variant).replace(' ', '_')
block = f'minecraft:{block}'
blocks.append(block)
return blocks
def get_blocks_placed(stats:dict, block_list:list) -> int:
total_blocks_placed = 0
items_used = stats['stats']['minecraft:used']
for item, times_used in items_used.items():
if item in block_list:
total_blocks_placed += times_used
return total_blocks_placed
if __name__ == '__main__':
statistics_file = '<name-of-your-stats-file.json>'
block_list_file = 'blocklist.json'
print(f'Total number of blocks placed: {number_of_blocks_placed}')
```
This script requires you to do four things before running:
- Visit the [MCPropertyEncyclopedia](https://joakimthorsen.github.io/MCPropertyEncyclopedia/) website, click on "Blocks" in the top left and select "Export Json"
- Save the script I sent as a file called "blocksmined.py" (make sure file endings are shown, so you aren't saving it as "blocksmined.py.txt"
- In your copy of the script, replace `<name-of-your-stats-file.json>` with the path to your stats file from your world
- Run the script using python (you may need to install [python](https://www.python.org/downloads/) to do that)
Commentaires
* Downvote this comment if this post is poor quality or does not fit the purpose of r/Minecraft
* Downvote this comment *and report the post* if it breaks the [rules](https://www.reddit.com/r/Minecraft/wiki/rules)
----
(*Vote has already ended*)
It's tracking all the blocks placed individually already. (It's the "used" statistic for any placeable item)
```
import json
def load_stats(file_path:str) -> dict:
with open(file_path, 'r') as infile:
stats = json.load(infile)
return stats
def load_list_of_blocks(file_path:str) -> list:
with open(file_path, 'r') as infile:
block_list = json.load(infile)
blocks = list()
for block_type in block_list:
variants = block_type['variants']
if not isinstance(variants, list):
variants = [variants]
for variant in variants:
block = str.lower(variant).replace(' ', '_')
block = f'minecraft:{block}'
blocks.append(block)
return blocks
def get_blocks_placed(stats:dict, block_list:list) -> int:
total_blocks_placed = 0
items_used = stats['stats']['minecraft:used']
for item, times_used in items_used.items():
if item in block_list:
total_blocks_placed += times_used
return total_blocks_placed
if __name__ == '__main__':
statistics_file = '<name-of-your-stats-file.json>'
block_list_file = 'blocklist.json'
stats = load_stats(statistics_file)
block_list = load_list_of_blocks(block_list_file)
number_of_blocks_placed = get_blocks_placed(stats, block_list)
print(f'Total number of blocks placed: {number_of_blocks_placed}')
```
This script requires you to do four things before running:
- Visit the [MCPropertyEncyclopedia](https://joakimthorsen.github.io/MCPropertyEncyclopedia/) website, click on "Blocks" in the top left and select "Export Json"
- Save the script I sent as a file called "blocksmined.py" (make sure file endings are shown, so you aren't saving it as "blocksmined.py.txt"
- In your copy of the script, replace `<name-of-your-stats-file.json>` with the path to your stats file from your world
- Run the script using python (you may need to install [python](https://www.python.org/downloads/) to do that)