LitematicaFolia
Server-side Litematica for Paper and Folia. Load .litematic files straight onto the server, and let players on unmodified Litematica push their schematics up to it over Servux. No /fill spam, no getting kicked for spamming, no WorldEdit in the mix.
The problem this solves
Litematica is a client-only Fabric mod. Its server-side companions (Servux, Syncmatica) are Fabric-only too. So on Paper the only thing your players get is Litematica's /setblock fallback, and that fallback is rough: it drops tile entity NBT, entities and pending block ticks; the chat rate limit caps it around 20 blocks a second; and past roughly 30 commands a second Paper kicks them anyway.
LitematicaFolia is the missing server half for Paper. It:
- reads and writes
.litematicv6 and v7 with an inline NBT parser, so no extra dependencies - pastes through Folia's
RegionScheduler, one chunk task at a time, keeping TileEntity, Entity, PendingBlockTick and PendingFluidTick data intact - runs older files through DataFixerUpper at paste time
- speaks enough of the Servux wire protocol that a vanilla Litematica client can paste directly to the server, the same way it would against Fabric + Servux
Paste details worth knowing: observers and pistons go down in a second pass, physics is deferred, and there's a splitter cap (128 MiB by default) so 40 MiB+ schematics don't fall over.
The heaviest thing I've thrown at it is 4.2 million blocks, which took 9.5 seconds. Direct Paste peaked at 870k blocks with 6,500 tile entities in 5.6 seconds. No region file corruption in either case.
Commands are Brigadier-based, and the whole thing is MIT licensed.
What's new in 0.5.1 (MC 26.2)
First release for 26.2.
The other fix in here: Direct Paste now works on Leaves-lineage cores (Lophine, Leaves, etc.). Those server cores handle the Servux protocol themselves and were quietly swallowing the plugin's servux:* channels, so client uploads would just hang forever with no error. The plugin now reclaims its channels at startup. On plain Paper or Folia that's a no-op.
Tested against Paper 26.2 (build 62), a source-built Folia 26.2 with full end-to-end Direct Paste, and Lophine 26.2 in production.
Installation
- Grab
LitematicaFolia-<version>-all.jar - Drop it in
plugins/ - Restart (or hot-reload)
- If you want Direct Paste, set
protocol.enableServuxBridge: trueinplugins/LitematicaFolia/config.yml
Needs Paper or Folia 26.2 (forks are fine: Luminol, Lophine, Purpur) and Java 25. On 26.1.x, stay on the 0.4.x releases.
Client setup for Direct Paste
Players need Fabric Loader 0.16 or newer, Fabric API, MaLiLib and Litematica, all matching their Minecraft version.
Then, in Litematica's Configs → Generic tab:
| Setting | Value |
|---|---|
ENTITY_DATA_SYNC |
true |
PASTE_USING_SERVUX |
true |
PASTE_USE_FILL_COMMAND |
false |
PASTE_ALWAYS_USE_FILL |
false |
ENTITY_DATA_SYNC_BACKUP |
true |
ENTITY_DATA_SYNC is the one that catches people out. With it off, Litematica silently rejects our S2C_METADATA packet, drops back to /setblock spam, and the player gets kicked. Nothing in the UI tells you that's what happened.
They'll also need to bind executeOperation to a key in Configs → Hotkeys, since it's unbound by default.
Then the workflow is:
- Open the Litematica menu (
M) - Load Schematics, pick the file
- Loaded Schematics → Create Placement, position it
- Hold the Litematica tool (a stick)
- Cycle Tool Mode to "Paste Schematic in world"
- Look at the placement and hit the
executeOperationkey
Validated against litematica-fabric-1.21.11-0.27.6.
If you run Velocity
Direct Paste bursts trip the default 5 MiB/s packet limiter on anything over about a 10 MiB schematic, so in velocity.toml:
[packet-limiter]
decompressed-bytes-per-second = -1
Leave compression-threshold alone at 256.
For old files where the DataVersion is well behind current, give clients more headroom to finish DataFixer plus upload:
-Dpaper.playerconnection.keepalive=120
Commands
| Command | Permission |
|---|---|
/litematica paste <file> [x y z] [yaw] [--no-entities] [--no-physics] |
litematica.paste |
/litematica save <name> <x1 y1 z1> <x2 y2 z2> |
litematica.save |
/litematica materials <file> |
litematica.materials |
/litematica list [--filter <glob>] |
litematica.use |
/litematica info <file> |
litematica.use |
/litematica cancel [ticket] |
litematica.paste |
/litematica reload |
litematica.admin |
Configuration
paste:
maxBlocksPerChunkTask: 8192
allowEntities: true
allowTileEntities: true
allowPendingTicks: true
deferredPhysics: true
observersLast: true
runDataFixer: true
minDataVersion: 2586
protocol:
enableServuxBridge: false # off by default
enableEasyPlace: false
maxDirectPasteSize: 134217728 # 128 MiB, raise for 32M+ block schematics
Versus the alternatives
| LitematicaFolia | Litematica /fill fallback |
FAWE | |
|---|---|---|---|
.litematic support |
native | n/a (client-only) | not natively |
| Server-side paste | yes | no | yes, for .schem |
| Direct Paste from client | yes, via Servux | no | no |
| TileEntity preservation | full NBT | none | partial |
| Entity preservation | full NBT | none | partial |
| Pending block ticks | yes | no | no |
| Folia support | native | depends | partial |
| Rate-limit kick risk | none | high | none |
FAWE is still the better tool if you're doing general world editing; this plugin only cares about .litematic.
License and credits
MIT, and LGPL-clean: no upstream code was copied. The format parsing came from the public Litematica spec, with litemapy and Lite2Edit as references. The Servux wire format is matched byte-for-byte against sakura-ryoko/servux, re-verified as unchanged at 26.2-0.11.1.
Made by exo for the ekaii network, borrowing patterns from AxiomPaperPlugin and PaperMC.
Litematica is maruohon's work and the Servux protocol is sakura-ryoko's. This plugin wouldn't exist without either.
Tags: litematica, servux, schematic, litematic, paper, folia, server-side, direct-paste, nbt, paste, worldedit-alternative, building
All Versions
+ Add VersionThanks to **venson** for the report that surfaced this.
If an older 0.4.x jar was run on the wrong Minecraft version (for example 1.21.11), it could stop every player from joining. That is fixed two ways:
- The plugin now checks the server version at startup. If it is not 26.1.2, it disables itself cleanly with a clear message instead of interfering with connections.
- It no longer initializes PacketEvents unless you explicitly enable Easy Place, so by default there is nothing that could conflict with another plugin.
Running 26.2 or newer? Use 0.6.x or 0.8.x. Running 1.21.11? Use 0.9.0. This release is for Minecraft 26.1.2.
Big thanks to **stavapin** for an unusually thorough and precise bug report. This release works through it point by point so that a server-side paste matches exactly what the Litematica client shows.
- Fixed**
- Replace modes (None / With non-air / All) are now honored.
- Entities no longer land offset, and their fractional coordinates rotate correctly.
- Entity orientation now rotates and mirrors together with the schematic.
- Per-sub-region overrides (enabled, position, rotation, mirror) are applied.
- Paste layer behavior and render layer range are respected.
maxBlocksPerChunkTaskactually paces large pastes now instead of being advisory./litematica saveno longer captures an entity twice when it straddles a chunk border.- Bonus: block states such as stairs rotate and mirror correctly, and structure void is never pasted.
Validated with 103 unit tests and a 56-check fidelity suite across 12 scenarios on Folia 26.2. For Minecraft 26.2.
This is a real 1.21.11 build, not a compatibility shim. It has its own 1.21.11 server internals, a PacketEvents version that actually supports 1.21.11, and it speaks the Servux protocol that the 1.21.11 Litematica client uses. It also carries every placement-fidelity fix from 0.8.0.
- What works**
- Full Servux "Direct Paste" from a real Litematica 1.21.11 client. This was tested end to end on a live Folia 1.21.11 server: a genuine client connects, pastes, and the blocks and entities land correctly.
- Coexists with a separate PacketEvents plugin. By default the plugin does not touch PacketEvents at all; it only initializes it if you turn on Easy Place. Tested with a standalone PacketEvents installed and Easy Place enabled: clean joins, no conflict.
- Correct placement for rotation, mirror, per-sub-region overrides, replace modes, layer ranges, and entity position and orientation.
- Which version do I use?**
- Minecraft 1.21.11: this release.
- 26.2: 0.8.x. 26.1.2: 0.4.x/0.6.x. On any version it is not built for, the plugin now disables itself cleanly instead of interfering.
Thanks to **venson** for the report that led to proper 1.21.11 support, and to **stavapin** for the detailed placement report behind the fidelity fixes this build inherits.
- The plugin now checks the server version at startup and disables itself with a clear error on anything that is not Minecraft 26.2. Bukkit does not block a plugin built for a newer version, so the 26.2 jar could end up running on 1.21.x or 26.1.x servers with a mismatched packet pipeline, which could break every player join.
- PacketEvents is now only injected when Easy Place is enabled. The Servux bridge runs on plain plugin messages and never needed it.
Version guide: 26.2 -> this release, 26.1.x -> 0.4.x, 1.21.x and older -> unsupported.
## Added
- CoreProtect integration.** Pasted block changes are now recorded in CoreProtect when it's installed, under the player who started the paste (console/RCON pastes log as
#litematica). Replacements are logged WorldEdit-style: removal of the old block, then placement of the new one, so/co iand/co rollbackbehave exactly as they do after a WorldEdit operation. Unchanged blocks are skipped (re-pasting the same schematic writes zero records). Block states only for now; tile-entity NBT and entities are not logged. logging.coreprotectconfig toggle (defaulttrue). Measured cost on a 4.19M-block stress paste: 5.4 s without logging, 7.1 s with it, plus one CoreProtect consumer-queue entry per changed block. If you paste city-sized schematics and don't need the audit trail, flip it off.
## Changed
- Now built against the Paper 26.2 **stable** dev bundle (build 111). 0.5.1 was built on the build-62 beta bundle.
## Compatibility
- Requires CoreProtect API v10+ to log (the plugin prints the detected API version at startup). No CoreProtect, a too-old build, or a failing one: clean no-op, pastes are never affected.
- Heads-up for 26.2 servers: stock CoreProtect CE 24.0 predates Minecraft 26.2 and disables itself at boot ("Minecraft 26.2 is not supported"). You need a newer dev or patched CoreProtect build to actually get records on 26.2. Until then the integration simply stays dormant.
- Tested on **Paper 26.2** (build 111) and **Folia 26.2**: full unit suite, boot/paste/save smokes with and without CoreProtect, replacement semantics verified against the CoreProtect database, attribution checks, and the 4.19M-block + 629k-tile-entity stress paste on both plain and CoreProtect-enabled servers. Zero errors, all rows ingested. On Folia the logging calls run on region threads; no thread-safety issues in any run.
For 26.1.x servers, use the 0.4.x releases.
## Fixed
- Direct Paste on Leaves/lineage servers (Lophine, Leaves, …)** those 26.2 server cores handle the Servux protocol themselves and consumed the plugin's
servux:*channels before the plugin could see them: Litematica clients hung forever on *"The placement is being uploaded to Servux for pasting"*. The plugin now reclaims its channels automatically when the Servux bridge is enabled; on plain Paper/Folia this is a clean no op. /litematica savenow writes origin-normalized regions: re-pasting a schematic you saved lands exactly at the coordinates you give it, instead of inheriting the absolute world position it was saved from.
## Changed
- Servux wire format re-verified byte-for-byte against upstream Servux
26.2-0.11.1: Direct Paste from vanilla Litematica clients keeps working exactly as on a Fabric+Servux server. - Bundled PacketEvents upgraded to 2.13.0 (26.2 server version strings now parse).
- Cleaner protocol logging: one INFO line per inbound packet, hex dumps off by default.
## Compatibility
Tested on **Paper 26.2** (build 62, boot + paste), **Folia 26.2** (built from source, upstream has no published 26.2 build yet; boot + full Servux Direct-Paste end-to-end) and **Lophine 26.2** (production). For 26.1.x servers, use the 0.4.x releases.
Completes the v0.4.1 fix, which only moved the **pass-1** dispatch loop off the region tick thread.
- Root cause.** The pass-2 and deferred-physics-sweep loops were chained with a plain (non-async)
thenCompose, which runs on the thread that completed the upstream future, a Folia **region tick thread** (FoliaCompat.runOnRegioncompletes it there). Those loops then called the blockingacquireSlot()on that region thread; when the region still had more pending chunk tasks than freeCHUNK_THROTTLEpermits, it parked inSemaphore.acquire()waiting for permits only it could release → self-deadlock. Regions froze indefinitely (observed ~116h on a production server); the Folia Watchdog loggedTick region ... has not respondedwithout ever crashing.
- Fix.**
thenComposeAsync(..., offRegionExecutor) (Folia async pool / Paper async worker), so every acquireSlot() runs off-region, a blocked dispatch thread can no longer park a region.2.
acquireSlot() now uses tryAcquire(60s): a timeout dispatches the chunk unthrottled and logs a warning instead of blocking forever. The release guard is seeded so an untaken permit is never over-released.No config/schema change vs 0.4.1: in-place drop-in. Normal-load behaviour (32 in-flight chunk-task throttle) unchanged.
### Added
- Real Litematica 0.27.6 clients can now Direct-Paste their schematics to the server with full block-state, tile-entity, entity and pending-tick fidelity, validated in production with 869,514 blocks + 6,516 TEs in 5.6 s.
- Inline
LitematicaPastetask handler (the maruohon Litematica payload schema, separate from the upstream Servux multi-frame Transmit protocol; both now handled). - Servux BulkRequest fulfillment with per-player rate limiter.
- Easy Place V3 server-side scaffold (PacketEvents 2.7, gated off by default).
- Java protocol bot for autonomous validation (
test-harness/protocol-bot/). - Local Fabric client harness for visual smoke testing.
### Fixed
- Brigadier
StackOverflowErrorat command registration (recursive flag dedup via bitmask). /litematica pasteparses off the command thread → no more Folia Watchdog ERRORs on big files.PackedLongArrayswitched to compact cross-word packing (the.litematicformat).- 7 Servux wire-format discrepancies vs upstream
sakura-ryoko/servux 26.1.2-0.10.2. - PacketSplitter cap raised 16 MiB → 128 MiB, configurable.
- Proactive
S2C_METADATApush 3 s after PlayerJoin so Litematica clients enter Servux mode without user action.
### Production gotchas documented (in README + TUTORIAL)
- Litematica client config: **must** set
ENTITY_DATA_SYNC = truein Generic config;PASTE_USING_SERVUX = truealone is useless. - Velocity 3.5: set
[packet-limiter] decompressed-bytes-per-second = -1(default 5 MiB/s kicks Direct Paste). - Paper: add
-Dpaper.playerconnection.keepalive=120for clients running DataFixer on old.litematicfiles.
### Performance
- 4,194,304 blocks + 629,533 tile entities in 9.5 s (stress fixture).
- 870 k blocks + 6.5 k tile entities in 5.6 s (real client Direct Paste).
- 62 JUnit tests + 3 smoke harnesses all green.