Skip to main content

Sending custom blocks and items from a server

A Dragonfly (Go) server has no behavior pack (BP) or Script API runner. Go types define blocks and items, and the server sends those definitions to the client as NBT at join. Block definitions go in the block entries (name and compound) of the StartGame packet, and item definitions in the ItemRegistry packet. Textures, models and names come from the resource pack the server sends. The server side has no rule IDs like JSON UI, so this guide points to topic page sections as evidence.

When to use it​

What you wantMethod in this guideWhen it does not fit
Add custom blocks and items on a Go serverImplement world.CustomBlock, world.CustomItem and a resource packFor BDS or a single world, Making a custom block with an add-on
Add client components Dragonfly does not build (minecraft:digger, minecraft:use_modifiers, minecraft:fuel, tool tags, the type of light values)Edit the block entries and item list sent at join in a packet hookIf Dragonfly's own behavior must change, patch it in a fork
A custom block behaves like a vanilla slab, door, crop or leavesvanilla_block_data.block_archetype in the block entryBehavior not in the list is written in server code
Draw 3 items on a custom blockThe shelf_block archetype and Shelf block entity NBT in the chunkOther layouts or rotations need a custom entity holding the item
Draw sign text on a custom blockThe sign_block archetype and Sign NBT in the chunkText alone without the board is not possible
Make a custom block into an item frame or flower potNot possible even from a server; they are not in the archetype list {code (binary)}A custom entity holding the item
Use an archetype from behavior pack JSONNot possible. Add-on JSON rejects internal_vanilla_data on custom blocks as a schema errorServer only
The block shape movesBlocks animate only textures (flipbook)An entity

Minimal example​

One shelf_block archetype custom block that draws 3 items. The setup is taken from the test recorded in the shelf item of section 6 of Blocks and the 28 archetypes section (2026-12-04 Windows 1.26.65, Dragonfly test server) {measured, code (binary)}. The Go code is shortened from the test server code in Shelf and sign block entity NBT.

Server-side steps:

  1. A Go block type implements world.CustomBlock. Textures of Properties() (customblock.Material) gives the face textures and render method. A full cube uses the vanilla minecraft:geometry.full_block and needs no model file; another shape puts an identifier in Properties().Geometry and the .geo.json in the resource pack's models/blocks/.
  2. Register one state only, and pick a name whose hash is the largest so it comes last in the block runtime ID list. The client builds the states of the shelf archetype itself (powered_shelf_type, powered_bit, minecraft:cardinal_direction), so they differ from the server's count. Placed last, it does not shift the runtime IDs of other blocks {measured}.
  3. The same type implements NBTer and returns the block entity NBT below. That puts the block entity into the chunk (subchunk).
  4. In a packet hook, edit that block's entry in StartGame (table below). Two changes: add the vanilla_block_data.block_archetype compound, and delete the top-level properties.
  5. To change the contents, send NBT of the same shape again with BlockActorData.

The code for steps 3 and 4. probeBlock is the block type of step 1, and hookConn is a connection that wraps the session.Conn returned by the Dragonfly listener. shelfArchName is the identifier picked in step 2.

type shelfNBTBlock struct {
probeBlock
data map[string]any
}

func (b shelfNBTBlock) EncodeNBT() map[string]any { return maps.Clone(b.data) }
func (b shelfNBTBlock) DecodeNBT(data map[string]any) any {
b.data = data
return b
}

func patchShelf(e *protocol.BlockEntry) {
if e.Name != shelfArchName {
return
}
data, _ := e.Properties["vanilla_block_data"].(map[string]any)
if data == nil {
data = map[string]any{}
e.Properties["vanilla_block_data"] = data
}
data["block_archetype"] = map[string]any{"type": "shelf_block"}
delete(e.Properties, "properties")
}

func (c *hookConn) StartGameContext(ctx context.Context, data minecraft.GameData) error {
for i := range data.CustomBlocks {
patchShelf(&data.CustomBlocks[i])
}
return c.Conn.StartGameContext(ctx, data)
}

The part of the block entry to edit (definition NBT written as JSON; keep every other key as Dragonfly built it):

{
"vanilla_block_data": {
"block_archetype": { "type": "shelf_block" }
}
}
KeyNBT typeWhat to do
vanilla_block_dataCompoundCreate it if missing
vanilla_block_data.block_archetypeCompoundAdd it
vanilla_block_data.block_archetype.typeStringOne of the 28 archetype names
propertiesList of CompoundDelete it
minecraft:geometry, minecraft:material_instances in componentsCompoundKeep them. Without them the block is invisible and only the items are drawn

The block entity NBT to put in the chunk (the data of shelfNBTBlock; the items and counts are example values):

func shelfData(pos cube.Pos) map[string]any {
stack := func(name string, count byte) map[string]any {
return map[string]any{"Name": name, "Count": count, "Damage": int16(0), "WasPickedUp": byte(0)}
}
return map[string]any{
"id": "Shelf",
"Items": []any{stack("minecraft:diamond", 1), stack("minecraft:apple", 3), stack("minecraft:golden_apple", 1)},
"BlockEntityVersion": int32(0),
"x": int32(pos.X()), "y": int32(pos.Y()), "z": int32(pos.Z()),
}
}
KeyNBT type
idString
ItemsList of Compound (3 slots)
Items[].NameString
Items[].CountByte
Items[].DamageShort
Items[].WasPickedUpByte
BlockEntityVersionInt
x, y, zInt

Resource pack (the pack the server sends):

pack/manifest.json
pack/textures/terrain_texture.json
pack/textures/blocks/custom_display_shelf.png
pack/texts/en_US.lang

pack/textures/terrain_texture.json: the key is the texture name given to the Go customblock.Material.

{
"resource_pack_name": "custom",
"texture_name": "atlas.terrain",
"texture_data": {
"custom_display_shelf": { "textures": "textures/blocks/custom_display_shelf" }
}
}

pack/texts/en_US.lang (for the block identifier custom:display_shelf; replace it with the real name chosen for the hash condition):

tile.custom:display_shelf.name=Display Shelf
  • The shelf renderer takes the position and size of its 3 slots from a constant table inside the renderer. Only the 4 directions from minecraft:cardinal_direction (the first direction when the state is missing) and the items placed can change {code (binary)}.
  • Neighbour checks use the names of the 13 vanilla shelves, so archetype custom shelves can be powered but never form a row with each other {code (binary)}.

Switching to a sign​

Set type to sign_block and put Sign NBT in the chunk with the same shelfNBTBlock. The keys are id (String, Sign), FrontText and BackText (Compound), IsWaxed (Byte) and x/y/z (Int), and each side compound has Text (String, lines split with \n), TextOwner (String), SignTextColor (Int, -1 is white), IgnoreLighting, HideGlowOutline and PersistFormatting (all Byte) (table). The sign renderer draws the board and post with the oak sign texture (textures/entity/sign), so the board stays even without geometry. Without geometry a dark box is drawn in front of the board too; full_block geometry with an alpha_test transparent texture leaves only the sign. When no direction state is sent, the board faces south {measured, code (binary)} (2026-12-04 Windows 1.26.65).

Must match​

  • Definition NBT types are strict. A key with a different type is read as missing and gets the default {code (binary)}. Do not copy BP JSON straight into NBT; use the vanilla data-driven block entries (Dragonfly world/data_driven_blocks.nbt) or a real packet as the model.

  • The key layout of definition NBT differs from BP JSON.

    BP JSONDefinition NBT
    "minecraft:tags" or "tag:<name>": {}Top-level blockTags of the entry (List of String)
    "minecraft:light_emission": 15"minecraft:light_emission": {"emission": <Byte>}
    "minecraft:light_dampening"{"lightLevel": <Byte>} {code (binary)}
    "minecraft:collision_box": {"origin", "size"}{"enabled", "boxes": [{"minX" ... "maxZ"}]}
    "minecraft:liquid_detection": {"detection_rules": [...]}{"detectionRules": [{"liquidType", "canContainLiquid", "onLiquidTouches", ...}]}
    description.internal_vanilla_data.block_archetype: {"slab_block": {...}}vanilla_block_data.block_archetype: {"type": "slab_block", ...}
    "minecraft:redstone_conductivity": {"redstone_conductor"}{"redstoneConductor", "allowsWireToStepDown"}
  • Send light emission as a Byte. A block sent with an Int (the Dragonfly default) did not light its surroundings at night {measured}.

  • Put tool tags in the top-level blockTags of the entry. As tag: components they have no effect {measured}.

  • Sort block properties (properties) by name. The client pairs runtime IDs with block states in order.

  • When giving an archetype, do not send properties. The client builds the states from the archetype itself. Sending properties too shifts runtime IDs {measured}.

  • The server must register the same states the client adds from the archetype for runtime IDs to match. For the slab, registering minecraft:vertical_half on the server matched {measured}. When the count cannot be matched, register one state and pick a name that sorts last in the runtime IDs (shelf) {measured}.

  • type must be one of the 28 below. A value not in the list is ignored silently and the block stays ordinary {code (binary)}. There is no experiment, format version or namespace check.

  • Add the keys the archetype compound reads. base_block of stair_block is required, and the block is not built when it names a missing block. stripped_block of log_block is looked up at build time, so register it first {code (binary)}.

  • An archetype gives no geometry or texture. The block entry needs minecraft:geometry and minecraft:material_instances, and the resource pack needs the textures.

  • Send the shelf and sign block entity NBT in the chunk. BlockActorData alone with no chunk NBT draws nothing {measured}.

  • Collision and selection boxes sent by the server are read in geometry space, whose x axis is opposite to the world. Flip boxes in x for shapes that differ east and west {measured}.

  • The block item in the inventory is drawn with the shape of the first state. Put the shape the item should show in state 0 {measured}.

  • Always put max_stack_size in the item's item_properties. A missing key reads as 0, and the item merged with another custom item {measured}.

  • A custom item that reacts to clicks in the air needs minecraft:use_modifiers in its client entry (for example use_duration 0.05, movement_modifier 1) {measured}. A custom fuel needs minecraft:fuel for the client to allow it in the furnace slot {code}.

  • Send names as translation keys: tile.<id>.name for blocks, item.<id>.name for items. Dragonfly puts the Name() text into minecraft:display_name of custom items, so change that value to item.<id>.name in the item list hook.

  • Put lang lines in both the lang file of the language used and en_US.lang. en_US.lang is the fallback for every other language.

  • Resource packs are cached by UUID + version. When the content changes, change the manifest.json version (computed from a content hash).

  • At join, send VoxelShapes with the default shapes minecraft:empty and minecraft:unit_cube. Dragonfly does not, and 1.26 clients log it {measured}.

The 28 archetype names (Windows 1.26.65): bush_block, button_block, carpet_block, crop_block, dirt_block, door_block, double_sapling_block, farm_block, fence_block, fence_gate_block, flower_bed_block, hanging_sign_block, leaves_block, log_block, mushroom_block, path_block, planks_block, pressure_plate_block, pumpkin_block, sapling_block, shelf_block, sign_block, slab_block, stair_block, stripped_log_block, trapdoor_block, wall_foliage_block, wall_sign_block. Only four get a block entity and a dedicated renderer: shelf_block, sign_block, wall_sign_block, hanging_sign_block. The rest change behavior only and the shape is drawn from the definition's geometry {inferred}. The states the client adds and the keys it reads per archetype are in the 28 archetypes table.

Common mistakes​

SymptomCauseFix
After joining, air shows as fire or lava and the floor as other blocksThe block state counts of server and client differ, so runtime IDs shifted (properties sent with an archetype, or the server registered a different number of states)Delete properties, and register the states the archetype adds, or one state with a name that sorts last {measured}
The archetype is given but the block behaves as an ordinary blocktype is spelled differently from the 28 names, or block_archetype is outside vanilla_block_dataFix the name and location {code (binary)}
The shelf block shows but has no itemsOnly BlockActorData was sent, without block entity NBT in the chunkHave the block type return the NBT through NBTer so it goes in the chunk {measured}
Only floating items show, no blockGeometry and materials were deleted from the block entryKeep minecraft:geometry and minecraft:material_instances {measured}
The archetype block shows the unknown block textureAn archetype gives no textureGive material_instances and a terrain_texture.json key {measured}
The sign board and post are blacktextures/entity/sign was made transparentRestore the texture. On a black board, give SignTextColor white (-1) {measured}
A dark box shows in front of the sign boardThe geometry was removedGive full_block geometry with an alpha_test transparent texture {measured}
A light-emitting block does not light its surroundingsemission was sent as an IntSend it as a Byte {measured}
Pickaxe mining time does not changeThe tool tag was added as a tag: componentPut it in the top-level blockTags {measured}
Two custom items merge or behave strangelyitem_properties has no max_stack_sizeAlways include it {measured}
Using a custom item in the air sends nothing to the serverThe client thinks the item cannot be usedAdd minecraft:use_modifiers {measured}
The item name shows the same text in every languageDragonfly put the Name() text into display_nameChange it to item.<id>.name in the item list hook
A key or identifier shows where the name should beThe lang line is missing, or missing from en_US.langPut it in both the language used and en_US.lang
Collision or selection boxes are mirrored left to right against the modelThe box x axis is opposite to the worldFlip the boxes in x {measured}
A custom block does not break after the cracks finishThe real client does not send a destroy action for custom blocksThe server breaks it when the break time has passed (Dragonfly patch)
The client keeps the old look after the pack changedThe pack version is the same, so the client used its cacheCompute the version from a content hash
Pack download failsChunks were sent too fast to a client after 1.26.30Leave a chunk send delay (gophertunnel default 200ms)
Drawing an item frame item on a custom block does not workThe item frame block entity exists only on vanilla minecraft:frame and minecraft:glow_frameUse the shelf_block archetype or a custom entity holding the item {measured, code (binary)}

Version conditions​

  • The measurements on this page use a Windows 1.26.65 client and Dragonfly master (protocol 1.26.60).
  • Windows 1.26.65 has 28 archetype names. The Android 1.26.52.3 binary has 27, without mushroom_block {code (binary)}.
  • 1.26 clients log a message when VoxelShapes is missing {measured}.
  • Clients after 1.26.30 may fail pack downloads when pack chunks are sent too aggressively.
  • minecraft:neighbor_change, minecraft:vibration_properties and minecraft:enchantment_power_transmitter pass an experiment check on Windows 1.26.65. Definitions received over the network appear to go through the same check, in which case the server's experiment settings decide {inferred}.
  • The wiki has no fact that changes this task in the 26.70 preview.

How to check​

  1. Keep a test that connects a fake client to the server once, hashes each received block entry and item registration, and compares them with golden files. Keep a golden by item name as well. Goldens should change only in changes meant to change what the client receives.
  2. Join with the game and first check that air and the floor look normal. If they show as other blocks, runtime IDs are shifted.
  3. Place the archetype block. For the example, 3 items are drawn on the block in the same layout as a vanilla shelf.
  4. Send other items with BlockActorData and see whether the drawing changes.
  5. For a light-emitting block, see whether the floor around it brightens at night; for tool tags, whether pickaxe mining gets faster.
  6. In the inventory, check the block item's shape (first state) and its name (current language).
  7. Look for definition errors in the content log. For example, an empty category in menu_category gives Menu Category should not have an empty value, and an unknown value gives Menu Category has an invalid value of ... {code (binary)}.
  8. After changing the pack, confirm that the pack version changed, then reconnect and see whether the client downloads the pack again.

Further reading​

Sources
idSourceLicenseCommitAccessed
private-researchPrivate research (-)-2026-11-13
dragonflyDragonfly (df-mc)MITd86aefd (baseline of a patch for one Dragonfly-based server)2026-11-13
gophertunnelgophertunnel (Sandertv)MIT (c) 2019 Sandertve2251a62026-11-13
bedrock-samplesMojang bedrock-samplesMinecraft EULA applies, (c) Mojang AB. All rights reserved15701fa9 (guide baseline 46ba6ea)2026-11-13
bedrock-protocol-docsMojang bedrock-protocol-docs(c) Mojang AB. All rights reserved (Minecraft EULA applies)88e783a2026-11-13
repo-ore-ui-loadingOre UI loading research (this repository) (ore-ui-loading/)This project's material2026-11-13
ms-learnMinecraft Creator documentation (Microsoft Learn)CC BY 4.0 (documentation), MIT (code)a9fd1c02026-11-13
bedrock-wikiBedrock WikiCC BY 4.0 (docs/licenses/CC-BY-4.0.md in the repository)0930b392026-11-13
repo-guideJSON UI comprehensive guide (this repository) (guide/)This project's material2026-11-13