Skip to content

Layers and crates

Changing. Follow: #60, #180, #287, #321, #460, #545, #566, #784

mcrs is a repository of 206 crates, sorted into seven layers. Each layer is meant to depend only on the layers below it, so you take the layers you need and pay for nothing above them. A proxy needs the bottom two layers, and a full server needs the first five.1

# Layer What it holds
1 Wire ids, positions, NBT, text, keys; the codec traits; framing, compression, encryption; handshake, status, login and configuration packets
2 Network the connection state machine, login on both sides, authentication, proxy forwarding, frames encoded once per broadcast
3 Game data and rules registries baked from the data pack, blocks, items, entities, chunks, Anvil saves and their packets; kernels without Bevy for lighting, world generation, block simulation, arm swings and damage
4 Engine Bevy plugins for worlds, dimensions, chunk sources, players, events and commands, and the drivers of the kernels; no vanilla behaviour by default
5 Vanilla what blocks, items and mobs do, world generation and lighting, as removable plugins
6 Rendering meshing and pipelines over layer 3 data; no network, client or server
7 Applications the server binary, the client, the examples and the tools

Every crate lives under crates/. A crate specific to the game is named mcrs_minecraft_<name>. A crate for a concept that does not depend on the game is named mcrs_<name>, such as mcrs_molang and mcrs_voxel. The crate map lists every crate with its layer.

Bevy is an optional feature below layer 4, and tokio is optional below layer 2, because only the network layer talks to tokio. CI checks some boundaries through layers in xtask/src/checks.rs. The check keeps game data out of mcrs_minecraft_protocol and mcrs_minecraft_network, and keeps the network, client and server out of model baking, item icons and entity rendering. It also rejects inventory layout or rules in mcrs_minecraft_protocol_game, and server crates in the inventory crates a client uses, such as mcrs_minecraft_inventory_client.

mcrs_raknet is a separate transport library without Bevy. Its core takes packets, buffers and timestamps from the caller; an optional tokio feature adds a UDP driver. It is not connected to the Minecraft server’s login path, so this transport alone does not give the server Bedrock support.

The engine is split by data ownership; the crate map gives the current boundaries.

The crate map also describes the GUI boundaries and Bevy requirements.

Layer 3 can stay free of Bevy because the rules of the game and the code that schedules them are separate pieces.

A kernel is plain Rust that owns the rules of one domain, such as block updates, lighting, world generation or entity motion. It uses no Bevy and no tokio. One step of a kernel is a function call. State and a view of the world go in, and writes and messages come out into buffers that the caller owns. The same inputs give the same outputs.

A driver runs a kernel. In layer 4 the driver is a Bevy plugin that reads the world, calls the kernel and writes the result back. Bevy stays the scheduler between systems, and mcrs adds no scheduler of its own between them. That decision is in section 13 of the sharding design note. Without Bevy a driver is a loop, which is why a bot, a map tool or a test can use a kernel directly.

For example, mcrs_minecraft_swing decides whether an arm swing can start, and mcrs_minecraft_damage calculates a hit. Both build without std or Bevy. Their engine plugins connect these rules to components, tick phases and packets.

World generation uses the same kernel and driver boundary, with the standalone API described in Use the crates in your project.

If you come from Paper, think of a kernel as the logic of a vanilla system with the server object removed, so you can call it from any place. The driver is the part that knows about ticks.

The project aims for “Minecraft as a set of crates”. This is how far that goes on 2026-11-30.

In CI, 147 packages build without Bevy, and a check in xtask/src/checks.rs fails when a crate below layer 4 requires Bevy. 22 packages also build without std, for the target wasm32v1-none, and 11 build for a browser, for the target wasm32-unknown-unknown.

The crates are not published on crates.io. Two things block that: some crates embed files from outside their folder, and the protocol and network APIs return anyhow errors.2 A git dependency works, and Use the crates in your project covers that route.

The first library examples live in examples/. Each one is a workspace package with a list of crates it must not link in examples/dependencies.json, and CI fails when one of those crates enters its dependency tree.3

Example What it shows
status_ping queries the status of a server without Bevy
inventory_save_viewer reads a player file without Bevy
player_attributes prints and edits the attributes in a player file without Bevy or the engine
loot_validate checks the loot tables of a data pack without the engine
inventory_minigame runs the inventory plugins without the packet edge of the inventory
inventory_bot_click joins a server as a bot without a window, a renderer or a GUI crate, and clicks in its inventory menu
worldgen_preview generates an area from data packs and writes PNG maps and slices without a server or client

There is still no proxy, lobby or map renderer to copy, and the one bot, inventory_bot_click, only runs a fixed script of inventory clicks. The planned hello_server, lobby and arena are the smallest servers that run the engine with no vanilla behaviour.4

The public API of layers 1 to 4 is not stable. Every pub item there will become a commitment to users, so it is being reviewed first.

Next: World data: sections, columns, entities.

  1. WIP#180 The direction: mcrs as a library, from a proxy to a full server. ↩ ↩2

  2. Undecided#321 Tracks the work that lets the protocol, network and game data crates be published. ↩

  3. Works#288 Adds workspace members under examples/ with a check of the dependency tree of each example. ↩

  4. WIP#287 Plans the minimal server, lobby and arena examples. ↩

Sources and verification

Verified: 26.4-snapshot-7, 1cf84286c, 2026-11-30

Related open issues:

  • #60 WIP Transport crate without Bevy
  • #180 WIP Direction: mcrs as a library, from a proxy to a full server
  • #287 WIP Minimal server, lobby and arena examples
  • #321 Undecided The protocol, network and game data crates can be published
  • #460 WIP Block simulation domains as kernels without the engine, over a world view the host implements
  • #545 WIP Library crates hold no locks or atomics without a measured reason
  • #566 Partial Direction: library code without shared ownership, locks, trait objects or hot-path allocation
  • #784 WIP Entity tracker usable without the engine