docs: add custom model variant examples to block-propertie

This commit is contained in:
eliotbyte
2025-10-28 23:09:48 +03:00
parent 2a1d2f9354
commit cd6b73f1eb
2 changed files with 52 additions and 0 deletions
+26
View File
@@ -98,6 +98,32 @@ Properties available for variance:
Variants are managed via `block.set_variant(x, y, z, index)`.
### Custom model variants (geometry switching)
You can use different custom models for different variants. Provide a separate `model-name` for each variant that needs different geometry. The renderer caches geometry per (block id, variant).
The base model (specified in root) becomes variant 0. The variants array maps to indices 1+.
Example (default + two custom variants):
```json
{
"model": "custom",
"model-name": "stairs_middle",
"state-based": {
"bits": 4,
"variants": [
{ "model": "custom", "model-name": "stairs_left" },
{ "model": "custom", "model-name": "stairs_right" }
]
}
}
```
In this example:
- Variant 0 = `stairs_middle` (from root)
- Variant 1 = `stairs_left` (from variants[0])
- Variant 2 = `stairs_right` (from variants[1])
## Lighting
### *emission*