Skip to main content
Version: 26.2

Chunk Events

dev.architectury.event.events.common.ChunkEvent

Fires when a chunk's data is saved or loaded, letting you attach and read your own persistent data. Both are notifications.

Events

EventListener methodWhen
SAVE_DATAsave(ChunkAccess, ServerLevel, SerializableChunkData)Just before a chunk's data is written.
LOAD_DATAload(ChunkAccess, ServerLevel, SerializableChunkData)Just before a chunk's data is read.

On SAVE_DATA, write your own values into the provided data so they're persisted alongside the chunk; on LOAD_DATA, read them back. The ServerLevel passed to load may be null.

Example

ChunkEvent.SAVE_DATA.register((chunk, level, data) -> {
// store your mod's per-chunk data into `data`
});

ChunkEvent.LOAD_DATA.register((chunk, level, data) -> {
// read your mod's per-chunk data back from `data`
});