TOLISTN

Python Script to Locate Bedrock Ores in GT6

This Python script scans all chunks within the already-generated portions of your world. It outputs coordinates of ores located at Y=0 with the tile entity ID gt.MetaBlockTileEntity and an m value contained in TARGET_ORES (these will almost always be bedrock ores under normal circumstances).
Make sure you have a sufficiently new Python version (3.9 or higher) before running the script.

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)

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top