Blocks¶
Blocks are represented by BlockData assets and registered in WorldSettings.
Main Assets¶
Assets/PixitGames/BlockWorld/Scripts/BlockData.cs
Assets/PixitGames/BlockWorld/GeneratedBlocks
Assets/PixitGames/BlockWorld/Editor/BlockCreatorWindow.cs
Block Data¶
| Field | Purpose |
|---|---|
| ID | Unique byte ID. 0 is air |
| Display Name | Name shown by tools or UI |
| Icon | Inventory icon |
| World Prefab | Full-size prefab used by chunk mesh generation |
| Drop Prefab | Prefab spawned when broken |
| Drop Self | Whether the block drops itself |
| Drop Override | Optional different block drop |
| Drop Amount | Number of items dropped |
| Base Break Time | Break time with no effective tool |
| Effective Tool Type | Tool type that speeds this block up |
| Tool Speed Multiplier | Break time multiplier when the effective tool is selected |
| Is Crafting Station | Enables right-click crafting station interaction |
| Ore Settings | Used when this block appears as an ore |
Tool-Based Breaking¶
Breaking is not gated by a required tool. Instead:
finalBreakTime = baseBreakTime * toolSpeedMultiplier
This multiplier is applied only when the selected hotbar tool matches Effective Tool Type.
Example:
| Block | Base Break Time | Effective Tool Type | Tool Speed Multiplier |
|---|---|---|---|
| Tree Trunk | 1.2 | Axe | 0.3 |
| Rock | 2.0 | Pickaxe | 0.3 |
| Soil | 0.8 | Shovel | 0.4 |
If the player does not have the matching tool selected, the block still breaks using Base Break Time.
Creating Blocks¶
Use:
Tools > Pixit Games > Block World > Block Creator
The creator can generate:
- Block data
- World prefab
- Drop prefab
- Materials
- Optional recipe
- Optional block registry entry
Important Rule¶
Always add generated blocks to:
WorldSettings.blocks
Unregistered block IDs cannot be resolved by chunk generation, inventory, recipes, drops, or placement.