> For the complete documentation index, see [llms.txt](https://docs.aethercube.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aethercube.fr/developers/protocol/contracts.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Contracts

The packets only say what is sent. The rules behind them are written as contract documents in `protocol/`. Each describes one area: the packets involved, the checks the server runs in order, and the events plugins can observe. The server and the client both implement them, and the shared test vectors keep the two in agreement.

Read the contract of an area before you write a protocol client or change that area.

| Document                                  | Area                                                                                                                                                                                                                      |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `voxel-encoding.md`                       | How a chunk's voxels are encoded in `ChunkData`, and the world join sequence.                                                                                                                                             |
| `terrain.md`, `terrain-v4.md`             | Terrain generation versions, biomes and structures of the built-in generator.                                                                                                                                             |
| `structures.md`                           | Generated structures, planning and generated boss arenas.                                                                                                                                                                 |
| `movement.md`                             | Player input, the deterministic movement step the client predicts with, corrections, flight, swimming and the entity area of interest.                                                                                    |
| `interaction.md`                          | Breaking, placing and using blocks: reach, line of sight, refusals and server events.                                                                                                                                     |
| `inventory.md`                            | Items, slots, inventory actions, equipment, drops and player profiles.                                                                                                                                                    |
| `containers.md`                           | Chests and container screens, moves between inventories, loot.                                                                                                                                                            |
| `crafting.md`, `smithing.md`, `forge.md`  | Crafting stations, tool tiers, wear, smelting, armour, repair and the working forge.                                                                                                                                      |
| `farming.md`                              | Crops, growth and cooking.                                                                                                                                                                                                |
| `combat.md`                               | Attacks, the damage formula, death and creature behaviour.                                                                                                                                                                |
| `creatures.md`, `bestiary.md`, `wilds.md` | Creature types, traits, packs, goblin warcamps, flying and swimming creatures.                                                                                                                                            |
| `companions.md`                           | Taming, companions and riding.                                                                                                                                                                                            |
| `abilities.md`                            | Stamina, mana, the dodge and the abilities.                                                                                                                                                                               |
| `bosses.md`                               | Boss arenas, threat, attacks, phases, the boss bar and rewards.                                                                                                                                                           |
| `progression.md`                          | Experience, levels, status effects and consumables.                                                                                                                                                                       |
| `npcs.md`                                 | NPCs, dialogue, shops, coins and quests.                                                                                                                                                                                  |
| `game-modes.md`                           | Survival, creative and spectator.                                                                                                                                                                                         |
| `creative.md`                             | Block models, block states, the creative inventory and pick block.                                                                                                                                                        |
| `environment.md`                          | Weather, the world border, difficulty and `/world`.                                                                                                                                                                       |
| `world-time.md`                           | The day and night clock and `WorldTimeUpdate`.                                                                                                                                                                            |
| `chat.md`                                 | Chat, commands and system messages.                                                                                                                                                                                       |
| `access-control.md`                       | The whitelist and bans: the order of the checks at admission, the rejection and disconnect reasons, the messages. See [Whitelist and bans](https://docs.aethercube.fr/developers/running-a-server/whitelist-and-bans.md). |
| `loading-screen.md`                       | The loading screen that servers and plugins customise.                                                                                                                                                                    |
| `content-packs.md`                        | Content packs, plugin items and creature types, screen effects and pack shaders. See [Content packs](https://docs.aethercube.fr/developers/content-packs/overview.md).                                                    |
| `launch.md`                               | How the launcher starts the client and hands it a connection ticket.                                                                                                                                                      |
| `singleplayer.md`                         | How the client runs a local world with the game server.                                                                                                                                                                   |
| `vectors/`                                | Test vectors written by the server and checked by the client.                                                                                                                                                             |
| `materials/baseline.toml`                 | The material registry both sides embed. Its BLAKE3 hash is checked in the handshake.                                                                                                                                      |

## Material registry

The material registry maps block ids to their properties. The client and the server each embed the same baseline. The server sends the hash of its registry in `ServerHello`, and the client sends its own in `ClientCapabilities`. A mismatch is rejected as `INCOMPATIBLE_REGISTRY`. Plugins cannot add blocks, because the hash would no longer match.

## Launcher to client hand-off

The launcher starts the client with three arguments, `--ipc-endpoint`, `--ipc-token` and `--home`. The endpoint is a named pipe on Windows and a Unix socket elsewhere. The connection ticket, the server address and the optional certificate pin travel over that channel and never appear on the command line. Messages are a little-endian `u32` length followed by UTF-8 JSON of at most 64 KiB. The client sends `ipc.handshake` within 5 seconds, receives `ipc.launch` and answers `ipc.ack`. The details are in `protocol/launch.md`.

## Changing a contract

A change to a contract updates the schema, the document, the server and the client together. The protocol version is bumped when a change breaks existing clients. See [Tests and checks](https://docs.aethercube.fr/developers/building-from-source/tests-and-checks.md) for the `buf` checks.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aethercube.fr/developers/protocol/contracts.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
