Skip to content

Use the crates in your project

WIP: not implemented yet or partly. Follow: #60, #287, #291, #293, #294, #321

You can use an mcrs crate in your own Rust project today through a git dependency with a pinned commit and a nightly compiler. The crates are not on crates.io. This docs check did not test the route in a clean external project, so the setup below remains WIP with known limits.

[dependencies]
mcrs_minecraft_protocol = { git = "https://github.com/PfauLabs/mcrs", rev = "51d45c26ae772bd71fb1e02caae8cab2e5ad4495", default-features = false }

Cargo finds the crate by its name inside the repository, so the same git URL works for every mcrs crate. Use one rev for all of them in your dependency tree.

Do not write branch = "main". The main branch moves to the next game snapshot, and the crates change shape with it, so your build can break without a change on your side. The repository has 11 tags, and a commit hash is the exact way to pin.

The repository pins nightly-2026-09-02 in rust-toolchain.toml. This pin does not follow a git dependency. Install a nightly yourself and pin it in your project, ideally the same date.

Stable compiler support for the lower layers has not been verified here. It is part of the publishing question, so use the pinned nightly for this route.1

The crates are grouped into layers, from the wire protocol at layer 1 up to the applications at layer 7. The wire, data and rules crates are intended to work without Bevy. For mcrs_minecraft_protocol, default-features = false in the dependency line above leaves its optional Bevy integration off.

CI checks 147 package names with cargo check --no-default-features. The list is NO_BEVY_PACKAGES in xtask/src/checks.rs, and the crate map marks each of them.

Layer 4 uses Bevy to schedule the rules. The higher layers contain both pure behavior crates and Bevy plugins, so check the crate’s manifest. Below the engine, mcrs_minecraft_assets still requires Bevy even with default features off.

Run this in your project to see whether Bevy or tokio reached your dependency tree:

Terminal window
cargo tree -e normal --prefix none | grep -i -E "bevy|tokio" || echo "no bevy, no tokio"

If Bevy shows up for a crate from the no-Bevy list, that is a bug in mcrs, so please open an issue. The same command shows tokio, which is an optional feature below layer 2.

For a terrain tool, call WorldTables::build with parsed registries, blocks and templates, then DimensionPlan::build for a seed and dimension. Both builders return typed errors. Its fill_context feeds generate_area, which returns the filled columns of a rectangle. The library reads no files; worldgen_preview loads packs and writes PNG views. DirectoryPacks::with_pack stacks extra standard packs in caller order.

For the item stack model and its codecs, see Inventory and the remaining migration in RFD 8.

For client column ingestion, Column::decode in mcrs_minecraft_client_world returns a typed ColumnDecodeError, so a host can match section, light and unknown-biome failures.

For text, mcrs_minecraft_text_flatten::flatten takes Projection::Drawn or Projection::Plain and a TextHost; NoHost supplies the empty host. mcrs_minecraft_lang::template_pieces returns a Result for translation templates.

Several lower-layer APIs are usable before their engine integration: mcrs_raknet has a sans-I/O transport and an optional tokio UDP driver; GameRulePreset and McrsGameRule provide game-rule values; VerticalWindow and VerticalGridPolicy translate coordinates and select a window; mcrs_minecraft_pathfind provides path-type tables and queries. The server does not yet use these for Bedrock transport, rule presets, vertical rebasing or path search.

The crates are not all ready to publish or package. A crate that reads files outside its own folder at build time needs those files to be packaged too. Known cases are crates/mcrs_minecraft_core/src/version.rs, which reads assets/minecraft/version.json, and the Bevy integration in crates/mcrs_minecraft_network/src/server.rs, which embeds assets/mcrs/server-icon.png. A git dependency works because Cargo checks out the whole repository.1

Several public protocol and network APIs still return anyhow errors. Framing already has a typed FrameError with is_incomplete(), and PacketDecoder::try_next_packet() returns Ok(None) when it needs more bytes. A caller can distinguish an incomplete frame from a malformed one without matching error text.

The programs under examples/ are workspace members and take their dependencies with workspace = true, so they need the repository’s workspace. The smallest tutorial is Parse SNBT in your own project. Its external-project setup was not retested in this docs check either.

The API is not stable. Types change with every game snapshot, so pin a rev and read the changes before you move it.

mcrs has no artifact on Maven Central and no plugin jar that you drop into a folder. There is also no decision yet on a plugin loader, whether for jars, wasm or scripts. The project rejected only a facade and a Bukkit-like API, and that decision says nothing about a loader.4 Today your own code is a Rust plugin for Bevy that you compile together with the server, as Not Paper explains.

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

  2. Works#288 Workspace members under examples/, each with a dependency-tree test. ↩

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

  4. Not planned#437 The decision against a facade or an API crate: the public surface is the crates and plugins. ↩

Sources and verification

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

Related open issues:

  • #60 WIP Transport crate without Bevy
  • #287 WIP Minimal server, lobby and arena examples
  • #291 WIP Read, query and edit a saved world without the engine
  • #293 WIP Echo chat bot over the network layer only
  • #294 WIP Microsoft account sign-in as a standalone library
  • #321 Undecided The protocol, network and game data crates can be published