When /locate (or any caller of StructureCheck: exploration maps, eyes of ender) examines a candidate chunk that has never been generated, it scans the chunk's NBT on disk to see whether a structure start is already stored there. That scan has a permanent side effect: it creates the region file it was about to read.
The chain, Mojang mappings, 26.1.2 and 26.2:
StructureCheck.tryLoadFromStoragecallsChunkScanAccess.scanChunkwhich reaches
RegionFileStorage.scanChunk->getRegionFilegetRegionFileunconditionally constructs aRegionFilewhose constructor opens the file with
StandardOpenOption.CREATE
So every candidate chunk in ungenerated terrain leaves a 0-byte .mca file in the world save. Candidate chunks for spread structures are roughly one per placement region, so a wide search touches a new region file almost every time.
Measured on the official 26.2 server jar, fresh world, seed 20260821: the new world has 4 region files. One /locate structure minecraft:mansion from spawn brings it to 15 files, 10 of them 0 bytes. One /execute positioned 100000 100 100000 run locate structure minecraft:mansion brings it to 105 files, 99 of them 0 bytes - 89 empty files from a single command.
The files carry no information and nothing reads them: deleting all of them and re-running the identical locate returns the same position in the same time, and simply creates them again. They accumulate forever, are never cleaned up, inflate backups and directory listings, and make the region folder of an explored-by-locate world look generated when it is not.
Steps to reproduce:
Create a new world (any seed; the numbers above used 20260821).
Count the files in
<world>/dimensions/minecraft/overworld/region- a handful exist from spawn generation, none of them 0 bytes.Run
/locate structure minecraft:mansion, or for a bigger effect/execute positioned 100000 100 100000 run locate structure minecraft:mansion.Count again: new
.mcafiles of exactly 0 bytes, roughly one per candidate chunk the search examined.
What I expected: Reading a chunk that does not exist does not modify the world save.
A note on the fix shape: A region file that does not exist cannot contain the chunk being scanned, so scanChunk can answer "no data" for a missing file without opening it (an existence check, or an open mode without CREATE for read paths). That also skips the scan work itself, which is the subject of MC-311321.
Environment
Numbers measured on the official 26.2 dedicated server jar on Windows 11; the code path is platform independent.
This is fixed in 26.3 Snapshot 10, alongside the MC-310693 fix. RegionFileStorage.getRegionFile now takes a create flag, every read and scan path passes false, and a region whose file does not exist is cached as absent instead of being created.
Verified with the reproduction from the description, on a fresh vanilla server with the same seed and commands on both versions (buried_treasure and pillager_outpost from spawn, mansion from x=200000): 26.2 ends with 82 empty 0-byte .mca files across the region, poi and entities folders; Snapshot 10 ends with zero. This can be resolved as Fixed for 26.3 Snapshot 10.