> 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/content-packs/models.md). Agents can also search and read this documentation through its [MCP server](https://docs.aethercube.fr/~gitbook/mcp).

# Models

This page explains how to make a model for an item or a creature. Models are voxel models in the MagicaVoxel `.vox` format. A model is a folder with a `model.json` and one `.vox` file for each part.

```
models/keel_drifter/
├── model.json
├── hull.vox
├── lantern.vox
└── fin.vox
```

Draw the parts in MagicaVoxel or any tool that writes `.vox`.

## `model.json`

```json
{
  "model_id": "skyglass:drift_shard",
  "format": "magica_voxel",
  "version": 1,
  "rig": "prop",
  "voxel_size": 0.04,
  "nodes": [ { "id": "root" }, { "id": "shard", "parent": "root", "pivot": [0, 0.03, 0] } ],
  "parts": [ { "id": "shard", "file": "shard.vox", "parent": "shard", "origin": [3.5, 2.5, 0] } ]
}
```

| Field        | Meaning                                                                                                                                                     |
| ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model_id`   | The id, `namespace:name`. The data tables refer to it.                                                                                                      |
| `format`     | `"magica_voxel"`.                                                                                                                                           |
| `version`    | `1`.                                                                                                                                                        |
| `rig`        | `humanoid`, `quadruped` or `prop`: the joint layout that built-in animation drives.                                                                         |
| `voxel_size` | Blocks per voxel. Characters use 0.1.                                                                                                                       |
| `nodes`      | The hierarchy. Each has `id`, an optional `parent` and an optional `pivot`: the translation from the parent, in blocks, in engine axes (Y up).              |
| `parts`      | The `.vox` files. Each has `id`, `file`, the `parent` node and `origin`: the point of the file's grid, in voxels and in `.vox` axes, that sits on the node. |
| `sockets`    | Attachment points. Each has `name`, `parent` node, `position` in blocks, `rotation` in degrees (applied Y, then X, then Z) and `scale`.                     |

Parents must exist and the hierarchy must have no cycle. Numbers must be finite and bounded. `file` is a plain file name inside the model's folder.

## `.vox` rules

* One model per file.
* At most 128 voxels along each axis and 65 536 voxels in all.
* At most 2 MiB.
* Every colour is opaque.
* The front of the model is on its **-Y** side, which is what MagicaVoxel's front view shows. The client maps a `.vox` point `(x, y, z)` to `(-x, z, y)`, so an entity faces the way you drew its front.

A pack holds at most 1024 models.

### Caps and budgets

A model has at most 64 nodes, 64 parts and 64 sockets.

Every part is a mesh. Parts that use the same file with the same `origin` share one mesh, so a model with a hundred different origins of one file costs a hundred meshes. Before any mesh is built, the voxels (the entries of the `.vox` files) and the faces (quads) of the distinct meshes are counted against these budgets:

| Budget                    | Voxels  | Quads   |
| ------------------------- | ------- | ------- |
| One model                 | 131 072 | 100 000 |
| One pack                  | 262 144 | 200 000 |
| All the packs of a server | 524 288 | 400 000 |

A voxel shows a quad on each side that no voxel of the same file covers. A model, a pack or a set of packs over its budget is refused as a whole.

The server reads each `model.json`, `.vox`, `item_models.json`, `entity_models.json`, `animations.json` and clip with the client's rules when it builds the pack: unknown keys, types, ranges, limits and the budgets above. A pack that loads on the server loads on every client.

## Rigs

The rig picks the joint layout that the built-in animation drives. A state with no clip of your own keeps the built-in animation of the model's rig. A `prop` has no built-in animation, so it stays still unless you give it clips. See [Animations](https://docs.aethercube.fr/developers/content-packs/animations.md).

### Humanoid requirements

Nodes: `root`, `pelvis`, `spine`, `chest`, `neck`, `head`, `left_shoulder`, `left_arm`, `left_hand`, `right_shoulder`, `right_arm`, `right_hand`, `left_leg`, `left_foot`, `right_leg`, `right_foot`.

Sockets: `head`, `face`, `back`, `left_hand`, `right_hand`, `left_hip`, `right_hip`, `chest`, `feet`, `mount`.

The built-in model `core:humanoid` (`game-client/assets/models/characters/humanoid/`) is a complete example.

A model that fails validation is skipped, and its entities keep their box.

## Binding a model to an item

`data/item_models.json`:

```json
{
  "version": 1,
  "items": {
    "skyglass:drift_shard": { "model": "skyglass:drift_shard", "socket": "right_hand_upright" }
  }
}
```

| Field    | Meaning                                                                                                                      |
| -------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `model`  | The model id.                                                                                                                |
| `socket` | The socket of the holder's model the item is attached to. `right_hand_upright` stands a small item upright in the main hand. |
| `scale`  | A size factor.                                                                                                               |
| `worn`   | The equipment code the model is drawn for.                                                                                   |
| `also`   | More models on more sockets: the pieces of armour.                                                                           |

A block item needs no entry: it shows as a small cube of its material. An item with no model and no entry shows a drawn fallback. When the plugin's `ItemDefinition.model` is set, it is used if no entry names the item.

## Binding a model to a creature

`data/entity_models.json` maps an entity type to a model id:

```json
{ "version": 1, "entities": { "skyglass:keel_drifter": "skyglass:keel_drifter" } }
```

A creature type with no model is drawn as a box sized by its `width` and `height`. A plugin can also set `CreatureDefinition.model`, which the client uses when no entry names the type.

A dropped item shows its model too, turning slowly.

## Replacing a built-in model

Give your model the id of a built-in one, for example `core:wild_boar`. Players on your server then see yours. Later packs win over earlier ones.


---

# 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/content-packs/models.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.
