-
Notifications
You must be signed in to change notification settings - Fork 0
JSON Content System
garrison hinson-hasty edited this page May 4, 2021
·
25 revisions
There's a lot of "stuff" that needs to be represented in the world, so having automatic content loading is super convenient. The content system loads data from JSON files in the assets folder, and saves them to be used and reused. It also tries to provide helpful messages when something is missing, it isn't perfect but will catch most common mistakes.
JSON objects in the textures.json and blocks.json lists follow these formats:
| Key | Type | Status | Possible Values |
|---|---|---|---|
name |
string |
required | |
type |
string |
required | sprite, texture, voxel, connected, sheet |
path |
string |
optional, defaults to name | path from assets/ without file ending |
transparent |
bool |
required, except for voxels and sprites* |
*voxels and sprites are never transparent.
| Key | Type | Status | Possible Values |
|---|---|---|---|
name |
string |
required | |
type |
string |
optional, defaults to stateless | stateless, plant |
texture |
string |
optional, defaults to name | texture name |
sheet cell |
v2i |
optional | initial sheet cell for sheet textures |
collision |
string |
optional, defaults to default | none, custom, default |
bbox |
bbox_t |
required for custom collision | [v3d position, v3d size] |
subtype |
string |
required for certain block types* | name of subtype (see below) |
**see subtypes below for which are required *
| Key | Type | Status | Possible Values |
|---|---|---|---|
name |
string |
required | |
fullgrown |
int |
required | maximum growth value (number of textures - 1) |
growth-rate |
double |
required | growth delta per second |