# Hitbox, Java and Bedrock

There are two types of boxes: the Java hitbox, made of barrier blocks, and for Bedrock, a collision box and a selection box.

## Java: The Hitbox Grid

The Java hitbox is a 3-layer × 3-row × 3-cell grid. Each cell is either `0` (empty) or `1` (barrier block).

- Layer `0` is below the item, layer `1` at its level, and layer `2` above it.
- The center cell of layer `1` is the block of the item itself.
- Filled cells must form a square base box.

A chair that is two blocks high:

```json
[
  [[0,0,0],[0,0,0],[0,0,0]],
  [[0,0,0],[0,1,0],[0,0,0]],
  [[0,0,0],[0,1,0],[0,0,0]]
]
```

Vyse infers the exported box (`cuboid`): length, width, height, and offsets. This field is read-only.

## Bedrock: Collision and Selection

On Bedrock, a block has two boxes, in pixels (1/16 of a block), measured from the center of the bottom of the block:

| Box | Bedrock Component | Role | Limits |
|---|---|---|---|
| `collisionBox` | `minecraft:collision_box` | What stops the player | x and z from -8 to 8, y from 0 to 24 |
| `selectionBox` | `minecraft:selection_box` | The outline shown when aiming at the block | x and z from -8 to 8, y from 0 to 16 |

A box is `{"origin": [x, y, z], "size": [x, y, z]}`. A full block has origin `[-8, 0, -8]` and size `[16, 16, 16]`. A size of `[0, 0, 0]` means "no box".

> **Note:** these settings never modify the Java item. They are stored separately, in the Bedrock view of the project.

For an item, Vyse provides `suggestedCollisionBox`, inferred from the Java hitbox (limited to 24 pixels high):

```bash
curl "https://api.vyse.cloud/api/v1/projects/<projectId>/bedrock/assets/furniture/<furnitureId>" \
  -H "Authorization: Bearer vyse_..."
```

```json
{
  "platform": "bedrock",
  "kind": "FURNITURE",
  "exportEnabled": true,
  "conversionStatus": "CONFIGURATION_REQUIRED",
  "collisionBox": null,
  "selectionBox": null,
  "suggestedCollisionBox": {"origin": [-8.0, 0.0, -8.0], "size": [16.0, 24.0, 16.0]}
}
```

To apply it, with a selection box of half a block:

```bash
curl -X PATCH "https://api.vyse.cloud/api/v1/projects/<projectId>/bedrock/assets/furniture/<furnitureId>" \
  -H "Authorization: Bearer vyse_..." -H "Content-Type: application/json" \
  -d '{"collisionBox": {"origin": [-8,0,-8], "size": [16,24,16]}, "selectionBox": {"origin": [-8,0,-8], "size": [16,8,16]}}'
```

A box outside limits is rejected with a reason, for example "selectionBox y must stay between 0 and 16 pixels (origin 0 + size 24)". `null` removes a box.

> **Important:** the Bedrock view stores these settings, but Vyse does not yet produce a complete Bedrock pack. The Bedrock export of a Java project remains rejected until it can be made complete.

## Next Steps

- [Java and Bedrock](/reference/java-and-bedrock)
- [The API](/automate/the-api)
