Mojira Archive
MC-227443

Buried treasures always generate at the center of a chunk

The bug

Buried treasures seem to be always generated at the (9, Y, 9) chunk coordinates. This removes a big part of the challenge of uncovering the treasure if you have the map, since you'll already know where it is when using the F3 debug screen.

Analysis (tentative)

It seems that buried treasures are hardcoded to generate in this position.

net.minecraft.world.level.ChunkPos.BuriedTreasureFeature.java (Mojang mappings, 1.18-pre6, variable renamings)
...
 private static void generatePieces(...) {
        BlockPos blockPos2 = new BlockPos(pieceGeneratorContext.chunkPos().getBlockX(9), 90, pieceGeneratorContext.chunkPos().getBlockZ(9));
        structurePiecesBuilder.addPiece(new BuriedTreasurePieces.BuriedTreasurePiece(blockPos2));
    }
...