jMCX provides a comprehensive solution for Minecraft world file manipulation with clean, efficient APIs:
- 🎯 Complete Anvil Region Format Support - Read, edit, and write .mca region files
- 🛠️ Fluent Builder API - Modern builder pattern for easy structure creation
- 📦 Smart Compression - Automatic detection and support for GZIP, ZLIB, and uncompressed files
- 🔧 Interface-Based Design - Clean APIs
- ⚡ Type Safety - Minimal casting
Read region file:
AnvilReader reader = new AnvilReader();
Region region = reader.readRegion(new File("r.0.0.mca"));
List<Chunk> chunks = region.getChunks();Edit chunk blocks:
Optional<IChunk> chunkOpt = region.getChunk(0, 0);
if (chunkOpt.isPresent()) {
IChunk chunk = chunkOpt.get();
ICompoundTag nbt = chunk.getNBTData();
IListTag sections = nbt.getList("sections");
// Replace dirt with diamond in block palette
for (int i = 0; i < sections.size(); i++) {
ICompoundTag section = (ICompoundTag) sections.get(i);
ICompoundTag blockStates = section.getCompound("block_states");
IListTag palette = blockStates.getList("palette");
for (int j = 0; j < palette.size(); j++) {
ICompoundTag block = (ICompoundTag) palette.get(j);
if ("minecraft:dirt".equals(block.getString("Name"))) {
block.setString("Name", "minecraft:diamond_block");
}
}
}
}Copy chunk data:
Optional<IChunk> targetChunk = region.getChunk(1, 1);
if (targetChunk.isPresent()) {
targetChunk.get().setNBTData(chunk.getNBTData());
}Write modified region:
AnvilWriter writer = new AnvilWriter();
writer.writeRegion(region, new File("r.0.0-updated.mca"));Find chunks with entities:
List<Chunk> ownableChunks = region.getChunksWithOwnables();
for (Chunk chunk : ownableChunks) {
System.out.println("Chunk at " + chunk.getChunkX() + ", " + chunk.getChunkZ());
}- Complete CRUD operations (Create, Read, Update, Delete)
- Compression formats: GZIP, ZLIB, None
- Chunk Management: Coordinate extraction, payload handling, ...
- Many convenience methods (chunkHasOwnableEntities, getChunkByCoordinates, etc.)
- Enhanced editing operations
- LZ4 compression support
- Bedrock Region format support
- McRegion (Alpha) Level format support
- Graphical interface (maybe!)
Explore the examples/ folder for comprehensive usage patterns.
mvn clean packageAlways backup your world files before modification. While thoroughly tested, data corruption is always possible with world file manipulation tools.
This library will be used by:
- MinecraftOfflineOnlineConverter - Player data migration with UUID conversion
Built with:
- jNBT - NBT file manipulation
Minecraft is a registered trademark of Mojang AB.