TemplateWorld is an AllayMC plugin that allows you to create worlds based on template worlds. It supports both temporary (runtime-only) and persistent worlds, making it ideal for mini-game servers, lobby systems, and any scenario where you need to create worlds from pre-defined templates. 🎮
- 🗺️ Create temporary or persistent worlds from pre-defined templates
- 💨 Temporary worlds are runtime-only and won't persist to disk
- 💾 Persistent worlds preserve modifications using copy-on-write storage
- 📦 Support for different world storage formats (LEVELDB, etc.)
- 🧹 Automatic cleanup of temporary world files on server restart
- 🔌 Simple API for programmatic world creation
- 📦 Download the latest release from Releases
- 📂 Place the JAR file in your server's
pluginsfolder - 🚀 Start the server
- Create a folder named
templatesin your server root directory - Copy your world folder into
templates/ - The folder name will be used as the template name
server/
├── templates/
│ ├── lobby/
│ ├── bedwars_map1/
│ └── skywars_map1/
└── ...
| Command | Description | Permission |
|---|---|---|
/template create <template_name> |
Create a temporary world from a template | templateworld.command |
First, you should add the dependency to your project:
repositories {
mavenCentral()
}
dependencies {
compileOnly(group = "org.allaymc", name = "template-world", version = "0.1.0")
}Temporary worlds are runtime-only — they get a random UUID as their name and are automatically cleaned up when unloaded or on server restart.
import org.allaymc.templateworld.TemplateWorld;
import org.allaymc.api.world.World;
// Create a temporary world using default LEVELDB format
World tmpWorld = TemplateWorld.createTmpWorld("bedwars_map1");
// Create with custom formats
World tmpWorld = TemplateWorld.createTmpWorld(
"bedwars_map1", // template name
"LEVELDB", // template format
"LEVELDB" // temporary world format
);Persistent worlds are not runtime-only — their modifications are preserved across chunk unloads. Reads check the persistent storage first, then fall back to the template for unmodified chunks.
import org.allaymc.templateworld.TemplateWorld;
import org.allaymc.api.world.World;
// Create a persistent world using default LEVELDB format
World world = TemplateWorld.createPersistentWorld(
"bedwars_map1", // template name
"my_game_room" // persistent world name
);
// Create with custom formats
World world = TemplateWorld.createPersistentWorld(
"bedwars_map1", // template name
"LEVELDB", // template format
"my_game_room", // persistent world name
"LEVELDB" // persistent world format
);- 📂 Template worlds are stored in the
templates/directory - 📖 When a world is created, chunks are read from the template but written to a separate storage location
- 💨 Temporary worlds: written to
worlds/.tmp/, each gets a unique UUID as its name, and are marked asruntimeOnly - 💾 Persistent worlds: written to
worlds/<worldName>/, modifications are preserved via copy-on-write — unmodified chunks are read from the template, modified chunks are read from the persistent storage - 🔄 On server restart, all temporary world files are automatically cleaned up, while persistent worlds retain their data
This project is licensed under the LGPL v3 License - see the LICENSE file for details.