DAI 4.1 // STATEFUL CONTENT
Persistent Block Data & Item Components
Build a JSON-owned machine/container and mutate item Data Components without a dedicated Java class per mechanic.
Build path
- Enable block stateSet block_entity/inventory/sync/tick settings.
- Write typed stateUse block_entity set/add/toggle/clear actions.
- Read itUse block_entity state and slot conditions.
- Mutate itemsUse item_component set/remove/copy.
- Keep transactions atomicPerform costs + mutation in one authoritative path.
Starter JSON
{
"block": {
"block_entity": true,
"inventory_slots": 9,
"block_entity_sync": true,
"block_entity_tick_interval": 20
}
}Next
Continue with Persistent Content State.