Skip to content

ChunkAPI

Manage custom data inside chunks without hassle.

Forge
Loaders
Forge
Downloads on Modrinth
18.5K
Followers on Modrinth
7
versions
23
Updated
July 27, 2026Jul 27
Published
in 2023
This is a library — other mods need it, and it adds nothing to the game by itselfRequired by 1 mods. Download it if another mod needs it.

At a glance

A library: other mods need it — required by 1 mods
Runs on Forge
For Minecraft 1.7.10
Needed in the game and on the server
Latest version — 0.8.4 from July 27, 2026
License LGPL-3.0-only — free
Where it's needed
In gamerequiredOn serverrequired

Needed both in the game and on the server

Game versions1.7.10

A mod for adding custom data to chunks without the hassle of writing custom packets, event handling, loading hooks, and more.

Licensed under the LGPLv3 license

Originally developed by FalsePattern

Mod logo by Houstonruss

Goals

It is a goal to provide a way to add custom data to chunks without having to modify any vanilla classes. The API will also provide a simple way to implement the custom serialization/deserialization of the data, both for the networking and the NBT format. An optional goal is to provide a way to register DFUs for the custom data, but this is not a priority.

Non-Goals

It is not a goal to provide any kind of callback/hook system for anything except saving/loading and netcode, any kind of extra behavior should be implemented in the mod using ChunkAPI.

Storage is not provided by the API, the user is expected to implement their own storage system. A good example is using a mixin to add a field to the chunk class, and using that field to store the data.

Motivation

Modifying chunk packet data involved incompatibly modifying network packets, the chunk class, and the anvil chunk loader, which is a lot of work for a simple feature. This mod provides a way to add custom data to chunks without having to modify any of the vanilla classes yourself.

API and spec

The API exposes a way to add custom data to chunks, and a way to register custom serializers for the data.

ChunkDataManager

The ChunkDataManager itself is the primary class used for managing registrations, but does not implement functionality by itself. For that, you need to use the PacketDataManager, ChunkNBTDataManager, and SectionNBTDataManager interfaces included inside the ChunkDataManager class.

ChunkDataManager.PacketData

This interface is used for synchronizing data from the server to the client. If your data is only required on the server, you can freely skip implementing this interface.

ChunkDataManager.ChunkNBTData

This interface is used for saving/loading data from the chunk NBT. This is required if you want to keep persistent data across world reloads. Note, if you store data per block in the chunk, you should use SectionNBTData instead, as it is designed with the internal chunk format in mind.

ChunkDataManager.SectionNBTData

This interface is mostly identical to ChunkNBTData, but is designed for storing data per block in the chunk. Instead of being called once per chunk, it is called once per chunk section (16x16x16 blocks, ExtendedBlockStage class).

ChunkDataRegistry

This is where you actually register your manager. You need to do all registrations inside the init phase. You can also disable specific manager IDs by calling disableDataManager, but this is not recommended, and should only be used if you know what you are doing. You need to do all the disabling inside the postInit phase.

Packet specification

ChunkAPI modifies the S21PacketChunkData and S26PacketMapChunkBulk vanilla packets, and overwrites their default formats.

All sizes in the tables below are specified in bytes.

S21PacketChunkData new format:

Size (bytes)DatatypeName
4intX position
4intZ position
1boolForce Update
2shortExtendedBlockStorage mask
4intUncompressed data length
4int(n) Compressed data length
nbyte[n]Compressed data

S26PacketMapChunkBulk new format:

Size (bytes)DatatypeName
2short(n) Chunk count in packet
n * 4int[n]Uncompressed chunk data lengths
4int(m) Compressed data length
11Contains skylight data
mbyte[m]Compressed data
n * 10(int, int, short)[n]Chunk Headers (x, z, ebs mask)

In both cases, the compressed data is populated through the ChunkDataRegistryImpl.writeToBuffer method. The layout of this data is as follows:

Size (bytes)DatatypeName
4int(n) Manager count
n * varyingMGRDataManager data

Manager data:

Size (bytes)DatatypeName
4int(n) Manager name length
nUTF-8 strManager name
4int(m) Manager data length
mbyte[m]Manager data

Dependencies

FalsePatternLib

UniMixins

FAQ

How to install ChunkAPI?

Install Forge for your Minecraft version, download ChunkAPI for the same version and loader, put the file into the mods folder and launch the game with the loader profile.

Which Minecraft versions does ChunkAPI support?

ChunkAPI has builds for Minecraft 1.7.10.

Is ChunkAPI needed on the server?

Needed in the game and on the server

License and source
GNU Lesser General Public License v3.0 onlyfree to use and share; changes to the mod itself must be published under the same license
Original — Modrinth↗Files unchanged, verified with SHA-512Is this your mod? For rights holders

The site uses cookies: the necessary ones for sign-in and the theme, plus the Yandex Metrica and LiveInternet visit counters — they show us how the site is used. We have no advertising cookies. More