# Content pack Format
## Component
A component is a script that controls how a certain type of content acts.
It's the code behind blocks, entities, and more.
We currently plan to use [Squirrel](http://squirrel-lang.org/) for component scripts. This is subject to change
Components for different things (blocks, items, etc) would be mutually incompatible with one another.
## Root Layout
### `root.json5`
This file sits at the root of the pack, and provides metadata for the pack, such as the name and description
An example:
```json5
{
name: "A cool pack!",
description: "A cool description!",
version: "1.0",
game: {
// The version(s) of the game your pack is known to work with
targetVersion: [">=1.0", "<1.1"],
// Whether to require the pack be loaded on the target version
// Will fail if true and version isn't within the range
requireExactVersion: false
}
}
```
### `/{group}`
This is where you'll store the data in your pack.
For example, `/voxel` stores the data for the `voxel` group
### `/{group}/assets`
This stores assets for the game, such as models, textures, and translations
### `/{group}/content`
This stores content for the game, such as biomes, blocks, and entities
## Blocks
### Components
Block components hold block states, interaction code, and potential block entities
### Properties
Block properties tell the game how the block is treated by interactions such as explosions, breaking, and tool requirements
### `content/blocks`
This stores block definitions, and their behaviour
### `content/blocks/{block}.json5`
This is the block json.
An example:
```json5
{
components: [
{
// Base properties for the block
id: "voxel:block/base",
// The chance the block won't be exploded. 1 is never explode, 0 is always explode
explosion_resistance: 0.1,
// The preferred tool to break it
tool: "voxel:shovel",
// Whether to require the tool to break it
require_tool: false,
// Break time in seconds
break_time: 1
},
{
// Spread to nearby dirt
id: "voxel:block/spread",
spread_to: "voxel:dirt"
},
{
// Decay if a solid block is above this
id: "voxel:block/decay_without_air",
decay_into: "voxel:dirt"
}
]
}
```
## Json Patches
Sometimes you need to modify some content in another pack
We're drawing inspiration from [RFC 6902](https://datatracker.ietf.org/doc/html/rfc6902)
### `{thing}.json5.patch`
This file holds how the patch should work.
It should be in the same path (relative to pack root, not necissarily same pack), and have the same name as the json, except with the addition of `.patch`
### Format
TODO!