{"id":16145581,"url":"https://github.com/falsepattern/chunkapi","last_synced_at":"2026-02-23T05:01:42.824Z","repository":{"id":336925900,"uuid":"994325470","full_name":"FalsePattern/ChunkAPI","owner":"FalsePattern","description":"Manage custom data inside chunks without hassle.","archived":false,"fork":true,"pushed_at":"2026-02-06T19:56:53.000Z","size":852,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-02-07T06:06:43.081Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://falsepattern.com","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"LegacyModdingMC/ChunkAPI","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FalsePattern.png","metadata":{},"created_at":"2025-06-01T17:44:20.000Z","updated_at":"2026-02-06T19:55:01.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/FalsePattern/ChunkAPI","commit_stats":null,"previous_names":["falsepattern/chunkapi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/FalsePattern/ChunkAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FChunkAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FChunkAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FChunkAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FChunkAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FalsePattern","download_url":"https://codeload.github.com/FalsePattern/ChunkAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FalsePattern%2FChunkAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29738083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T04:51:08.365Z","status":"ssl_error","status_checked_at":"2026-02-23T04:49:15.865Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","forge","minecraft","minecraft-forge","minecraft-mod"],"created_at":"2024-10-10T00:16:54.222Z","updated_at":"2026-02-23T05:01:42.814Z","avatar_url":"https://github.com/FalsePattern.png","language":"Java","readme":"# ChunkAPI \u003cimg src=\"src/main/resources/chunkapi.png\" align=\"right\" width=150\u003e\n\n\u003csup\u003e**[CurseForge](https://www.curseforge.com/minecraft/mc-mods/chunkapi) | [Modrinth](https://modrinth.com/mod/chunkapi)**\u003c/sup\u003e\n\nA mod for adding custom data to chunks without the hassle of writing custom packets, event handling,\nloading hooks, and more.\n\n### Licensed under the LGPLv3 license\n\n### Originally developed by FalsePattern\n\n### Mod logo by Houstonruss\n\nGoals\n-----\n\nIt is a goal to provide a way to add custom data to chunks without having to modify any vanilla classes.\nThe API will also provide a simple way to implement the custom serialization/deserialization of the data,\nboth for the networking and the NBT format.\nAn optional goal is to provide a way to register DFUs for the custom data, but this is not a priority.\n\nNon-Goals\n---------\n\nIt is not a goal to provide any kind of callback/hook system for anything except saving/loading and netcode, any kind\nof extra behavior should be implemented in the mod using ChunkAPI.\n\nStorage is not provided by the API, the user is expected to implement their own storage system. A good example\nis using a mixin to add a field to the chunk class, and using that field to store the data.\n\nMotivation\n----------\n\nModifying chunk packet data involved incompatibly modifying network packets, the chunk class, and the anvil chunk loader,\nwhich is a lot of work for a simple feature. This mod provides a way to add custom data to chunks without having\nto modify any of the vanilla classes yourself.\n\nAPI and spec\n-----------\n\n\u003c!-- TODO update --\u003e\n\nThe API exposes a way to add custom data to chunks, and a way to register custom serializers for the data.\n\n### ChunkDataManager\nThe `ChunkDataManager` itself is the primary class used for managing registrations, but does not implement functionality\nby itself. For that, you need to use the `PacketDataManager`, `ChunkNBTDataManager`, and `SectionNBTDataManager`\ninterfaces included inside the ChunkDataManager class.\n\n### ChunkDataManager.PacketData\nThis interface is used for synchronizing data from the server to the client. If your data is only required on the server,\nyou can freely skip implementing this interface.\n\n### ChunkDataManager.ChunkNBTData\nThis interface is used for saving/loading data from the chunk NBT. This is required if you want to keep persistent data\nacross world reloads. Note, if you store data *per block* in the chunk, you should use `SectionNBTData` instead, as it\nis designed with the internal chunk format in mind.\n\n### ChunkDataManager.SectionNBTData\nThis interface is mostly identical to `ChunkNBTData`, but is designed for storing data per block in the chunk.\nInstead of being called once per chunk, it is called once per chunk section (16x16x16 blocks, `ExtendedBlockStage` class).\n\n### ChunkDataRegistry\nThis is where you actually register your manager. You need to do all registrations inside the `init` phase.\nYou can also disable specific manager IDs by calling `disableDataManager`, but this is not recommended, and should\nonly be used if you know what you are doing. You need to do all the disabling inside the `postInit` phase.\n\n### Packet specification\n\nChunkAPI modifies the S21PacketChunkData and S26PacketMapChunkBulk vanilla packets, and overwrites their default\nformats.\n\nAll sizes in the tables below are specified in bytes.\n\nS21PacketChunkData new format:\n\n| Size (bytes) | Datatype | Name                       |\n|--------------|----------|----------------------------|\n| 4            | int      | X position                 |\n| 4            | int      | Z position                 |\n| 1            | bool     | Force Update               |\n| 2            | short    | ExtendedBlockStorage mask  |\n| 4            | int      | Uncompressed data length   |\n| 4            | int      | (n) Compressed data length |\n| n            | byte[n]  | Compressed data            |\n\nS26PacketMapChunkBulk new format:\n\n| Size (bytes) | Datatype             | Name                            |\n|--------------|----------------------|---------------------------------|\n| 2            | short                | (n) Chunk count in packet       |\n| n * 4        | int[n]               | Uncompressed chunk data lengths |\n| 4            | int                  | (m) Compressed data length      |\n| 1            | 1                    | Contains skylight data          |\n| m            | byte[m]              | Compressed data                 |\n| n * 10       | (int, int, short)[n] | Chunk Headers (x, z, ebs mask)  |\n\nIn both cases, the compressed data is populated through the ChunkDataRegistryImpl.writeToBuffer method.\nThe layout of this data is as follows:\n\n| Size (bytes) | Datatype | Name              |\n|--------------|----------|-------------------|\n| 4            | int      | (n) Manager count |\n| n * varying  | MGRData  | Manager data      |\n\nManager data:\n\n| Size (bytes) | Datatype  | Name                    |\n|--------------|-----------|-------------------------|\n| 4            | int       | (n) Manager name length |\n| n            | UTF-8 str | Manager name            |\n| 4            | int       | (m) Manager data length |\n| m            | byte[m]   | Manager data            |\n\n\n\nDependencies\n------------\n\n[UniMixins](https://github.com/LegacyModdingMC/UniMixins)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalsepattern%2Fchunkapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffalsepattern%2Fchunkapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffalsepattern%2Fchunkapi/lists"}