Java parser for the .schem/.schematic/.litematic Minecraft formats. 🗺
Format | Extension | Links |
---|---|---|
Sponge Schematic | .schem | Spec: v1 • v2 • v3 |
Litematica | .litematic | Spec • Discussion |
Schematica | .schematic | Spec |
Add the following dependency to your build file.
If using Gradle (build.gradle
):
repositories {
mavenCentral()
}
dependencies {
implementation 'net.sandrohc:schematic4j:1.1.0'
}
If using Maven (pom.xml
):
<dependency>
<groupId>net.sandrohc</groupId>
<artifactId>schematic4j</artifactId>
<version>1.1.0</version>
</dependency>
For development builds, please see: https://jitpack.io/#net.sandrohc/schematic4j
Here are some examples on how to use this library:
// Load schematic from a file.
// Currently supported formats include .schematic, .schem and .litematic.
Schematic schematic = SchematicLoader.load("/path/to/your.schematic");
schematic.name();
schematic.width();
schematic.height();
schematic.length();
schematic.block(0, 0, 0).name;
schematic.blocks().collect(Collectors.toList());
schematic.blockEntities().collect(Collectors.toList());
schematic.entities().collect(Collectors.toList());