Resource pack delivery: how a server sends packs
Concept
A server sends resource packs down to the client during join. The client caches a pack by UUID + version, and the server does not resend a pack whose UUID and version the client already has. So if you change the contents but the manifest.json version stays the same, the client does not receive the changed pack. Negotiation uses the ResourcePacksInfo, ResourcePackStack and ResourcePackClientResponse packets, and pack data is delivered in ResourcePackDataInfo and ResourcePackChunkData chunks. BDS handles this stage through the world's pack list (world_resource_packs.json) and texturepack-required, and custom servers handle it through library settings. The BDS-side settings are in ../basics/pack-delivery-and-encryption.mdx.
gophertunnel delivery settings (MIT)
The gophertunnel Listener splits pack data into chunks and sends them. (Source: gophertunnel-repo, minecraft/resource_pack_delivery.go)
Excerpt: resource_pack_delivery.go · minecraft/resource_pack_delivery.go · gophertunnel (Sandertv) · License MIT (c) 2019 Sandertv · Commit e2251a6const (// DefaultResourcePackChunkSize is the size of a single chunk of data from a resource pack sent by a// Listener: 128 KiB.DefaultResourcePackChunkSize = 1024 * 128// DefaultResourcePackChunkSendDelay is the delay a Listener leaves between ResourcePackChunkData// packets, so slow clients are not flooded while downloading packs. Clients after 1.26.30 may fail// resource pack downloads when pack chunks are sent too aggressively.DefaultResourcePackChunkSendDelay = 200 * time.Millisecond)
- Tune it with
ChunkSizeinResourcePackDeliveryConfig(0 means 128KiB) andChunkSendDelay(0 means 200ms, negative means no delay). Clients after 1.26.30 can fail the download if chunks are sent too aggressively. - A pack object has methods such as
Name,UUID,Version,Modules,Dependencies,HasScripts,HasBehaviours,HasTextures,HasWorldTemplate,DownloadURL,ChecksumandEncrypted(resource.Pack).Pack.WithContentKeysupplies the content key of an encrypted pack.
Server-side pack processing
A custom server can embed the resource pack in its executable (go:embed in Go) and process it into the form to send to clients when the server starts. The source files stay as they are, and only a temporary copy is changed. (Source: private research)
- Version: The
manifest.jsonversion is set automatically from a hash of the pack contents. The same contents give the same version, so the client cache is kept; when the contents change, the version changes and the client downloads again. If you encrypt, put the secret in the hash too. - JSON minify: Remove
//and/* */comments and whitespace from.jsonfiles (key order and strings stay as they are). Do not touchmanifest.json. If the file is still not valid JSON after removing comments, the server refuses to start (the game cannot read such a file either). JSON UI files have many comments, so this saves quite a lot of size. - Encryption: This works the same way as vanilla marketplace packs. Up to 26.63, the game fetched in-game Ore UI pages only from packs that were encrypted or had a
content.zipe. So a pack you did not encrypt, sent with an emptycontent.zipe, had its DDUI and Ore UI screens drawn{measured}. In 26.64 Mojang blocked resource pack access to Ore UI for a security reason, and now neither encrypted packs norcontent.zipepacks change Ore UI pages (Source: private research).- Each file is encrypted with AES-256-CFB8 using a 32-character key (the IV is the first 16 bytes of the key).
manifest.jsonandpack_icon.pngstay as they are. contents.jsonlists the paths and keys (the first 256 bytes are the header: version 0, magicFC B9 CF 9B, pack UUID), and the list is encrypted the same way with the pack's content key. The server gives the content key to the client at join (gophertunnelPack.WithContentKey).- If you derive the key from the server secret with HMAC, the same contents give the same key and version. If you lose or change the secret, the keys and versions of every pack change and clients download the packs again. Do not put the secret in the repository.
- The format is the same as the community tools (
akmalfairuz/bedrockpack,EncryptMyPack). - Encrypted files barely compress, so an encrypted pack's transfer size is close to its uncompressed size
{inferred}. Storing encrypted entries in the zip without compression (Store) therefore loses nothing, while without encryption Deflate shrinks large JSON well. Measured values{measured}: the main pack was 636 KB unencrypted and 2,507 KB encrypted before optimization, and 554 KB and 846 KB after. The total of six packs went from 764 KB to 666 KB unencrypted and from 2,961 KB to 1,260 KB encrypted. Each zip entry has about 150 B of header, so the file count also counts toward the size. Join times for the smaller packs are in "Measuring join time" in performance.mdx.
- Each file is encrypted with AES-256-CFB8 using a 32-character key (the IV is the first 16 bytes of the key).
- Limits: Encryption only makes picking up the files inconvenient. Because the key is given to the client, any connecting client can decrypt it, and a tool (
bedrockpack steal) decrypts everything at once. It is deterrence, not real protection. Do not put anything that must not be seen in the pack.
In Dragonfly, Resources.Required = true in server.UserConfig (the config-file form) forces the client to apply the pack at join. The value is copied to ResourcesRequired in server.Config (the code form), so the two names are the same setting {code} (chest-ui.mdx writes ResourcesRequired).
Example: sending an embedded pack with a content-hash version (Go)
The pack/ folder embedded in the executable with go:embed is processed in memory when the server starts. The first 3 bytes of the SHA-256 of the file names and contents become header.version in manifest.json (cutting to 3 bytes is a choice of this example), and the processed zip is read with resource.Read. NewServer turns on Resources.Required and gives the pack to a Dragonfly server. ListenConfig is the same setting for listening directly with a gophertunnel ListenConfig, with the default values written out for the chunk size and send delay.
package packdelivery
import (
"archive/zip"
"bytes"
"crypto/sha256"
"embed"
"encoding/json"
"io/fs"
"log/slog"
"strings"
"github.com/df-mc/dragonfly/server"
"github.com/sandertv/gophertunnel/minecraft"
"github.com/sandertv/gophertunnel/minecraft/resource"
)
//go:embed all:pack
var packFS embed.FS
func hashedPack() (*resource.Pack, error) {
hash := sha256.New()
files := map[string][]byte{}
err := fs.WalkDir(packFS, "pack", func(path string, d fs.DirEntry, err error) error {
if err != nil || d.IsDir() {
return err
}
data, err := packFS.ReadFile(path)
if err != nil {
return err
}
name := strings.TrimPrefix(path, "pack/")
files[name] = data
hash.Write([]byte(name))
hash.Write(data)
return nil
})
if err != nil {
return nil, err
}
var manifest map[string]any
if err := json.Unmarshal(files["manifest.json"], &manifest); err != nil {
return nil, err
}
sum := hash.Sum(nil)
manifest["header"].(map[string]any)["version"] = []int{int(sum[0]), int(sum[1]), int(sum[2])}
if files["manifest.json"], err = json.Marshal(manifest); err != nil {
return nil, err
}
var archive bytes.Buffer
zw := zip.NewWriter(&archive)
for name, data := range files {
w, err := zw.Create(name)
if err != nil {
return nil, err
}
if _, err := w.Write(data); err != nil {
return nil, err
}
}
if err := zw.Close(); err != nil {
return nil, err
}
return resource.Read(&archive)
}
func NewServer(log *slog.Logger) (*server.Server, error) {
pack, err := hashedPack()
if err != nil {
return nil, err
}
user := server.DefaultConfig()
user.Resources.Required = true
conf, err := user.Config(log)
if err != nil {
return nil, err
}
conf.Resources = append(conf.Resources, pack)
return conf.New(), nil
}
func ListenConfig(pack *resource.Pack) minecraft.ListenConfig {
return minecraft.ListenConfig{
ResourcePacks: []*resource.Pack{pack},
TexturePacksRequired: true,
ResourcePackDelivery: minecraft.ResourcePackDeliveryConfig{
ChunkSize: minecraft.DefaultResourcePackChunkSize,
ChunkSendDelay: minecraft.DefaultResourcePackChunkSendDelay,
},
}
}
It was only compiled, against Dragonfly v0.11.7-0.20261107232451-0f9a3a573626 and gophertunnel v1.63.0, and was not run in game {code}. When that Dragonfly's server.Config builds the listen settings it does not pass ResourcePackDelivery, so the chunk send delay of NewServer is the gophertunnel default (200ms) {code}. No server.Config field that changes this delay was found. Whether putting a listener built from the ListenConfig above into Config.Listeners is a way to change it was not checked {needs measurement}. The version computation above and pack acceptance at join were not checked in game {needs measurement}.
The evidence that an encrypted pack was trusted in Ore UI file lookup up to 26.63, and what content.zipe is, are in ../basics/pack-delivery-and-encryption.mdx (Source: repo-ore-ui-loading).
Pack encryption and CDN (community)
- CDN (
cdn_config.json): The client is picky. The Content-Type must be zip (application/zip; theapplication/x-zip-compressedthat GitHub Pages sends is also accepted) and aContent-Lengthheader is required. There is a case where a Cloudflare Workers response had no Content-Length and the client waited forever at "loading resources". For BDS to give a CDN link, the pack must be registered as required (for example the uuid/version insystem_resource_packs). The system folder cannot properly override the vanilla loot tables or the crafting catalogue, so putting the pack in the world is another option. Geyser also supports remote pack URLs: https://geysermc.org/wiki/geyser/packs{community confirmed} - CDN hosting: There is a case using Cloudflare R2 (free tier). If BDS does not recognize the resource pack, first check
pack_idandversioninworld_resource_packs.json. - Server-encrypted packs and Ore UI: Up to 26.63, a pack the server encrypted and sent made Ore UI load that pack's
hbui/. From 26.64 this is blocked. In gophertunnel, give the key withpack.WithContentKey(key). - Pack encryption (EncryptMyPack and others): It is for RPs only and does not work on vanilla BDS. You need PocketMine, Endstone, Dragonfly (recommended for Geyser users) or a proxy in front of BDS. The decryption key is received locally for an add-on, or during data exchange for a server pack. Skin packs share a single key.
- Audio constraint: By protocol, audio can be played only from a dynamic RP sent in advance.
PlaySoundPacketwas mentioned for client music.
CDN summary example (cdn_config.json)
{ "<pack UUID>_<pack version>": "https://cdn.example.com/my_pack.zip" }
The detailed requirements (list every non-vanilla RP with its exact version, a direct link, a correct Content-Length) are in ../basics/pack-delivery-and-encryption.mdx.
| id | Source | License | Commit | Accessed |
|---|---|---|---|---|
private-research | Private research (-) | - | 2026-11-13 | |
gophertunnel | gophertunnel (Sandertv) | MIT (c) 2019 Sandertv | e2251a6 | 2026-11-13 |
repo-ore-ui-loading | Ore UI loading research (this repository) (ore-ui-loading/) | This project's material | 2026-11-13 | |
ms-learn | Minecraft Creator documentation (Microsoft Learn) | CC BY 4.0 (documentation), MIT (code) | a9fd1c0 | 2026-11-13 |