gt.MetaBlockTileEntity and an m value contained in TARGET_ORES (these will almost always be bedrock ores under normal circumstances).import anvil
from anvil import Region,Chunk
from nbt import nbt
import os
# Write the ores you want to search for here; tungsten ore family is set as default.
TARGET_ORES = {
9128,
9133,
9193,
9194,
9195,
9196,
9197,
9217,
}
def scan_region_file(region_path):
region = Region.from_file(region_path)
print(f”Scanning {region_path} …”)
for chunk_x in range(32):
for chunk_z in range(32):
try:
chunk_db = Chunk.from_region(region, chunk_x, chunk_z)
if chunk_db is None:
continue
chunk_nbt = chunk_db.data[‘TileEntities’]
if chunk_nbt is None:
continue
for te in chunk_nbt:
if te[“y”].value != 0 or te[“id”].value != “gt.MetaBlockTileEntity”:
continue
if te[“m”].value in TARGET_ORES:
print(f”{te[‘x’].value},{te[‘z’].value}”)
except Exception as e:
continue
def scan_all_regions(world_folder):
region_dir = os.path.join(world_folder, “region”)
for filename in os.listdir(region_dir):
if filename.endswith(“.mca”):
region_path = os.path.join(region_dir, filename)
scan_region_file(region_path)
if __name__ == “__main__”:
# Enter your world save path here
SCAN_WORLD =
scan_all_regions(SCAN_WORLD)