Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/redned235/levelparser
A Minecraft level parser.
https://github.com/redned235/levelparser
anvil java-edition level mca mca-file mcje minecraft minecraft-world parser world world-parser
Last synced: about 12 hours ago
JSON representation
A Minecraft level parser.
- Host: GitHub
- URL: https://github.com/redned235/levelparser
- Owner: Redned235
- License: mit
- Created: 2022-12-30T23:01:19.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-06-04T00:08:11.000Z (over 1 year ago)
- Last Synced: 2025-01-16T19:22:06.840Z (26 days ago)
- Topics: anvil, java-edition, level, mca, mca-file, mcje, minecraft, minecraft-world, parser, world, world-parser
- Language: Java
- Homepage:
- Size: 82 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# LevelParser
A Minecraft level parser.
**Currently Supporting: Minecraft: Java Edition 1.19.x**
This project only supports Anvil world files at the moment, but has been designed in such a way that alternative formats can also be used.
## Usage
To start, you will need to create a `LevelParser` object like so:
```java
LevelParser parser = LevelParser.builder()
.input(Paths.get("input"))
.output(Paths.get("output"))
.reader(new AnvilLevelReader())
.writer(new AnvilLevelWriter())
.build();
```Afterward, create a new `AnvilLevel` which you can do like so:
```java
AnvilLevel level = new AnvilLevel(
0, // minHeight
256, // maxHeight
0, // worldTime
new LevelData( // levelData
new LevelData.LevelVersion( // levelVersion
false, // snapshot
"main", // series
3120, // dataVersion
"1.19.2" // name
),
"My World Name", // worldName
1, // gameType (1 = creative mode)
10, // spawnX
0, // spawnY
10, // spawnZ
System.currentTimeMillis(), // lastPlayed
false, // hardcore
true, // allowCommands
List.of("vanilla"), // enabledDataPacks
List.of(), // disabledDataPacks
new LevelData.WorldGenSettings( // worldGenSettings
false, // bonusChest
0, // seed
false, // generateFeatures
... // dimensions
)
)
);
```With this level, you can now manipulate it in any way. Once you are done modifying your level, you can write it by doing the following using your parser:
```java
parser.writeLevel(level);
```## Repository
### Gradle
```kotlin
repositories {
maven("https://jitpack.io")
}dependencies {
implementation("com.github.Redned235.LevelParser:anvil:master-SNAPSHOT")
}
```### Maven:
```xml
jitpack
https://jitpack.io
com.github.Redned235.LevelParser
anvil
master-SNAPSHOT
compile
```