Skip to content

Java parser for the .schem/.schematic/.litematic Minecraft formats. 🗺

License

Notifications You must be signed in to change notification settings

SandroHc/schematic4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Schematic4j

Latest version

Java parser for the .schem/.schematic/.litematic Minecraft formats. 🗺

Supported formats

Format Extension Links
Sponge Schematic .schem Spec: v1 • v2 • v3
Litematica .litematic Spec • Discussion
Schematica .schematic Spec

Installation

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

Usage

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());