This page is available as Markdown : https://docs.vyse.cloud/first-steps/hitbox-java-and-bedrock.md. Index of all the documentation for AI : https://docs.vyse.cloud/llms.txt (full version: https://docs.vyse.cloud/llms-full.txt).

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.

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.

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

BoxBedrock ComponentRoleLimits
collisionBoxminecraft:collision_boxWhat stops the playerx and z from -8 to 8, y from 0 to 24
selectionBoxminecraft:selection_boxThe outline shown when aiming at the blockx 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.
Hitbox, Java and Bedrock · First steps