Skip to main content

Custom items, blocks, entities and names (Dragonfly server)

Concept: how it differs from BDS​

In BDS, custom blocks, items and entities are defined with BP JSON and the Script API. A Dragonfly (Go) server has no BP or Script API runner. Instead, game logic is written in server-language code, and what is visible (textures, models, animations, sounds, language, particles, JSON UI) goes in a resource pack. The server sends the definitions to the client as components at join. In short, "an add-on = game logic written in Go + a resource pack". (Source: private research)

CategoryBDSDragonfly server
Resource pack (textures, models, animations, sounds, language, particles, JSON UI)Sent to the clientUsable as is. Sent to the client and applied
BP JSON (block/item/entity definitions, loot tables, recipes, spawn rules)Executed by the serverNot executed. The same content is defined in Go code
Script APIExecuted by the serverNot executed. Implemented in Go code
Custom block/item definitionsBP JSONDefined by Go types, and the server sends the components to the client
What you did in an add-onWhere to do it in Dragonfly
blocks/*.jsonGo block type
items/*.jsonGo item type
entities/*.json (BP)Go EntityType and behavior code
entity/*.entity.json (RP), models, animationsResource pack
loot_tables, recipesGo data. Vanilla recipes are built into Dragonfly
Script API eventsDragonfly player/world handlers
ui/*.json, sounds, particles, textsResource pack

Custom blocks​

If you implement world.CustomBlock in Go, Dragonfly sends the block definition to the client.

FeatureSupportedHow
Textures (including per face), render methodYesProperties().Textures (customblock.Material)
Custom model (geometry)YesThe identifier in Properties().Geometry, with the .geo.json in the resource pack's models/blocks/
Collision/selection box, rotation, scale, translationYesProperties()
Appearance per state (permutation)YesImplement States() / Permutations()
Light emission/blocking, mining time, friction, flammabilityYesImplement interfaces such as LightEmitter and BreakInfo
Block entity data, per-tick logic, interactionYesNBTer, TickerBlock, Activatable and so on
BP block components not in the list aboveLimitedDragonfly's internal packages build the components, so extending needs a fork
Client-side block animationLimitedOnly texture flipbooks. Replace motion of the shape with an entity

A block model file is the resource pack's models/blocks/<name>.geo.json. For each face, it uses from (0,0) of the 16x16 texture as far as the face size. UV values are not pixels; they map to the real texture as a ratio divided by the geometry's texture_width/texture_height. UV [0, 0] size [341.333, 1024] in a texture_width 1024 geometry drew the left third of a 48x18 texture, and size [16, 16] in a texture_width 16 geometry drew the whole 48x18 texture on one face (measurement record, 2026-11-19 Windows 1.26.65.1). One file can hold several geometries per fill stage (geometry.custom_<kind>_<0..8>), and a full block uses the vanilla minecraft:geometry.full_block, so it has no model file. A block texture is textures/blocks/<name>.png plus a terrain_texture.json key (custom_<name>), and changing only the file changes the texture. A test catches missing files and keys.

Block texture animation (flipbook)​

One entry in textures/flipbook_textures.json animates one tile of terrain_texture.json. The image is a vertical strip (width 16, height 16 x frame count) and takes ticks_per_frame, frames (an ordered array) and blend_frames (on by default). A custom block animates with no other component if the texture in material_instances is that tile. The two files are merged across packs. All blocks animate at the same tempo, and switching it on and off is done by changing the texture through block state permutations. In item icons it does not animate depending on the version (Source: private-research; Bedrock Wiki blocks/flipbook-textures).

Custom items​

  • Implement world.CustomItem (name, creative category) and call world.RegisterItem. The icon is found by the item identifier key in the resource pack's textures/item_texture.json.
  • For durability, food, armor, cooldown, projectiles and so on, components are attached automatically when the item implements the matching interface.
  • Textures are PNGs in the resource pack: textures/items/<name>.png (the item_texture.json key is the item identifier; a block item appears in the shape of the block, so it has no icon), textures/blocks/<name>.png.

Custom entities​

  • Go: create a world.EntityType (identifier custom:xxx, hitbox, NBT) and register it in the server entity registry. Registered identifiers are sent to the client at join (AvailableActorIdentifiers).
  • RP: with the same identifier, create the client entity definition (entity/*.entity.json), geometry, textures, animations and render controllers.
  • AI, movement and interaction are all implemented in Go.
  • If the entity implements item.Carrier, the held item is sent to the client and drawn on the rightItem bone of the geometry.
  • Caution: even if you change the geometry, the client uses its cache when the pack version is the same. Solve this by computing the pack version automatically from a content hash (resource-pack-delivery.mdx).
  • No way was found to make a custom entity pick a vanilla entity class the way a block archetype does. An idlist entry of AvailableActorIdentifiers has rid, id, bid, hasspawnegg and summonable, and the client reads and stores bid as an entity identifier too {code (binary)}. But a custom entity with bid set to minecraft:falling_block was not drawn as a falling block. Without a client entity definition nothing showed; with a minecart definition attached it was drawn as a minecart, the same as an entity without bid {measured} (Windows 1.26.65, once each). Items have no counterpart of block archetypes at all {code (binary)}.

Adding client components (editing entries at join)​

Custom item and block entries that Dragonfly builds contain only the components Dragonfly knows. To add other BP components, edit the entries sent to the client at join (the item list and block entries) in a packet hook. If you build it so that an item or block that implements an interface has its value read and a component added, game code does not need to know Dragonfly's internals. (Source: private research)

Things worth adding this way:

  • Items: minecraft:digger (mining speed per block and tool tag), minecraft:use_modifiers, minecraft:fuel.
    • The client sends air-use packets only for items it knows are usable. A custom item that must react to right-clicking the air needs minecraft:use_modifiers in its client entry (for example use_duration 0.05, movement_modifier 1). With this on one item, air clicks reached the server {measured} (2026-11-01).
    • A custom fuel needs minecraft:fuel in its client entry before the client lets the player put it in a furnace fuel slot. Without it the server can burn it but the client refuses the slot {code (binary)} (not yet checked in game).
  • Blocks: the tool tag of BreakInfo (the blockTags list at the top level of the entry; a tag: component has no effect, see the measurements below) and pickaxe tier, an interaction marker that sends the click to the server, per-permutation collision boxes and geometry bone visibility, and the render method name of the material (for example alpha_test_single_sided instead of alpha_test).
  • Block properties are sorted by name, to match the order in which the client numbers states.

Measured in block and item definition NBT​

With a Windows 1.26.65 client and a Dragonfly master (protocol 1.26.60) server, only the definition NBT sent at join was changed (2026-11-18). The client is strict about NBT value types and treats a value of the wrong type as missing {code (binary)}.

The definition NBT sent over the network often differs in key layout or type from a BP JSON with the same content. Do not convert BP JSON to NBT as is; take the vanilla data-driven block entries (Dragonfly world/data_driven_blocks.nbt) or real packets as the model. Examples:

BP JSONDefinition NBT
"minecraft:tags" or a "tag:<name>": {} componentthe blockTags string list at the top level of the entry
"minecraft:light_emission": 15"minecraft:light_emission": {"emission": <Byte>}
"minecraft:collision_box": {"origin", "size"}{"enabled", "boxes": [{"minX" ... "maxZ"}]}
"minecraft:liquid_detection": {"detection_rules": [{"liquid_type", "can_contain_liquid", "on_liquid_touches"}]}{"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"}
  • Light: send emission of minecraft:light_emission as a Byte. A block sent with a Byte lit the floor around it at night; a block sent with an Int (the Dragonfly default) did not {measured}. The client also reads lightLevel of minecraft:light_dampening as a Byte {code (binary)} (not yet checked in game).
  • Tool tags: put them in the blockTags string list at the top level of the block entry. With a diamond pickaxe the client finished breaking a block with blockTags: ["minecraft:is_pickaxe_item_destructible"] in 548 ms, a block with the same tag as a tag:minecraft:is_pickaxe_item_destructible component in 4453 ms, and a block with no tag in 4449 ms {measured} (once each). Vanilla data-driven block entries also send tags as blockTags.
  • Block archetype (vanilla_block_data.block_archetype): it works on a custom namespace block. Cloning a vanilla slab entry and sending {type: "slab_block", double_slab_block, is_double} showed a half-block height without any geometry. A stair_block (base_block) sent the same way showed a full cube. Both showed the unknown block texture {measured}.
    • Do not send properties with an archetype. Sending the entry without properties, as vanilla entries do, and registering the same states as the vanilla block on the server (minecraft:vertical_half for slabs) kept the world intact. Sending properties as well shifted the block runtime IDs, and air showed as fire and lava {measured}. The client builds the states from the archetype itself {code (binary)} (table below).

What the 28 block archetypes change​

Read from the Windows 1.26.65 client binary {code (binary)}. Of these, only the shelf, sign, slab and stair were measured in game.

  • There are 28 type names: 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.
  • There is no experiment, format version or namespace check. A type not in the list is silently ignored and the block becomes a plain block.
  • Only four get a block entity and a dedicated renderer: shelf_block (shelf), sign_block and wall_sign_block (sign), hanging_sign_block (hanging sign). The other 24 change behaviour only, and their look comes from the definition's geometry {inferred}.
  • The three sign archetypes fix the wood type to oak. They are drawn with the oak sign texture and give the oak sign item (Blocks page).
  • dirt_block, farm_block, log_block, stripped_log_block, planks_block, pumpkin_block and mushroom_block use a fixed material per archetype instead of the sent material.
  • door_block, button_block, pressure_plate_block, fence_block, fence_gate_block and path_block ignore the definition's collision box, and door_block, trapdoor_block, button_block, fence_block, fence_gate_block and path_block ignore its selection box (their own shape functions replace them) {inferred}.
  • mushroom_block is the small mushroom plant, not the huge mushroom block. planks_block does nothing except make the name key tile.planks.oak.name.

States the client adds and keys it reads, per archetype:

ArchetypeStates the client addsKeys read from the archetype compoundBehaviour gained
shelf_blockpowered_shelf_type, powered_bit, minecraft:cardinal_directionnoneshelf block entity, 3 drawn item slots
sign_blockground_sign_directionwall_sign_block (no reader found)standing sign, 16 directions
wall_sign_blockfacing_directionnonewall sign
hanging_sign_blockfacing_direction, ground_sign_direction, hanging, attached_bitnonehanging sign
slab_blockminecraft:vertical_halfdouble_slab_block, is_doubleslab; with is_double, a full block that drops the double_slab_block item
stair_blockweirdo_direction, upside_down_bit, minecraft:cornerbase_block (required; no block is built if it does not exist)stair collision and placement
carpet_blocknonenone1/16 high, breaks without support
door_blockopen_bit, upper_block_bit, door_hinge_bit, minecraft:cardinal_directionnonetwo-block door, opening, redstone
trapdoor_blockdirection, upside_down_bit, open_bitnonetrapdoor
button_blockfacing_direction, button_pressed_bitis_projectile_sensitivebutton, pressed by arrows
pressure_plate_blockredstone_signalnonepressure plate triggered by any entity
fence_blocknone (reads the definition's minecraft:connection_* states)nonefence shape and tall collision
fence_gate_blockopen_bit, in_wall_bit, minecraft:cardinal_directionnonefence gate
path_blocknonebase_block, block_to_till_into15/16 high, becomes base_block when covered, block_to_till_into with a hoe
dirt_blocknoneblock_to_till_intohoe tilling, seagrass from bone meal under water
farm_blockuses moisturized_amountbase_blockfarmland moisture and drying, reverts when trampled
log_blockuses pillar_axisstripped_block (looked up at creation, so register it first)axis placement, axe stripping, leaf decay updates
stripped_log_blockuses pillar_axisnoneaxis placement
planks_blocknonenonenone
pumpkin_blockuses the definition's minecraft:cardinal_directionis_lit, is_carvedfront face texture, golem building check
bush_blocknonenoneno collision, survives only on dirt, spreads with bone meal
crop_blockgrowth (max_age+1 values)seed_item, growth_points_threshold, min_growth_light_level, max_age, min_survival_light_level, min_bonemeal_age_increase, max_bonemeal_age_increase, grows_into_block, grows_into_feature, placement_surfacegrowth, light rules, bone meal, turns into a block or feature at max age
sapling_blockage_bitsingle_sapling_tree, single_sapling_tree_with_beehive, quadruple_sapling_treegrows into a tree
double_sapling_blockgrowth, upper_block_bitsame as abovetwo-block plant, grows into a tree
flower_bed_blockgrowth (4 values)has_stems, visual_heightstacking petals
wall_foliage_blockminecraft:cardinal_direction, plus growth when size_count is 2 or moresize_count, is_bonemealable, bounciness, fall_damage_multiplierwall-attached plant, bounce, fall damage scaling
leaves_blockupdate_bit, persistent_bitsaplingleaf decay, placed leaves persist, render layer by graphics setting
mushroom_blocknonefeature_to_bonemeal_intosmall mushroom, spreading, feature from bone meal

crop_block key defaults: growth_points_threshold 25, min_growth_light_level 9, max_age 7, min_survival_light_level 8, min_bonemeal_age_increase 2, max_bonemeal_age_increase 4. An empty placement_surface or supports_crops means farmland, supports_vegetation means dirt types, and any other value is read as a block name.

The server must register as many states as the client adds, or block runtime IDs shift. The client does not add a state whose name already exists, but what happens when the value counts differ was not measured. For the shelf, registering one state and picking a name that sorts last in the runtime ID list avoided the problem (Blocks page).

  • Item max_stack_size: without it in item_properties the client did not handle the item normally. It merged into another custom item, and splitting the stack again turned both into the other item {measured} (once). The client reads most item_properties keys unconditionally and writes 0 when one is missing {code (binary)}. Always include it.

Shelf and sign block entity NBT​

This is the block entity NBT the test server (block-component-probe, Dragonfly) sent for shelf_block and sign_block archetype blocks, in the chunk and with BlockActorData. With these types the three shelf items and the front and back sign text were drawn {measured} (2026-12-04, Windows 1.26.65).

Shelf:

KeyTypeValue sent
idStringShelf
ItemsList of Compound3 slots
Items[].NameStringitem identifier
Items[].CountBytecount
Items[].DamageShort0
Items[].WasPickedUpByte0
BlockEntityVersionInt0
x, y, zIntblock position

Sign:

KeyTypeValue sent
idStringSign
FrontText, BackTextCompoundthe 6 keys below for each side
FrontText.TextStringtext, lines split with \n
FrontText.TextOwnerString""
FrontText.SignTextColorInt-1 (white)
FrontText.IgnoreLightingByte0
FrontText.HideGlowOutlineByte0
FrontText.PersistFormattingByte1
IsWaxedByte1
x, y, zIntblock position

The code below is shortened from the test server. When a block type implements Dragonfly world.NBTer (EncodeNBT, DecodeNBT), Dragonfly puts that NBT in the chunk as the block entity. probeBlock is a block type that implements world.CustomBlock, and data is a map like the tables above (Byte is byte, Short is int16, Int is int32). The archetype is set by hookConn, which wraps the session.Conn returned by the Dragonfly listener and edits the block entries (data.CustomBlocks) in StartGameContext. shelfArchName is the identifier of the block that gets the archetype.

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)
}

A sign uses the same shelfNBTBlock with Sign NBT, and the entry's type is sign_block.

Names and translation​

  • Send names as translation keys. The client converts block and item names into its own language. Vanilla uses keys such as tile.stone.name and item.stick.name, and custom blocks and items use item.<id>.name and tile.<id>.name in the resource pack's texts/<language>.lang.
  • Dragonfly puts the Name() text as is into minecraft:display_name of a custom item. Then every client sees that one language. To make it appear per language, replace that value with the translation key item.<id>.name in the item list sent at join.
  • Put custom block and item names in both the lang file of the language you use and en_US.lang. On the client, en_US.lang is the fallback for every other language. When you add a language, create texts/<code>.lang and list it in languages.json.
  • The server must convert names in the text it sends (messages, forms, sidebars) into the player's language. For custom ones, the server reads the pack's texts/*.lang at startup; for vanilla ones, it uses a table built from bedrock-samples' resource_pack/texts/*.lang (see "Legacy translation keys" below). When you upgrade the game version, rebuild the table from the latest bedrock-samples.

Resource pack operating rules​

Dragonfly acts only as the BP. Turn off automatic pack generation (generated at server start from the textures/models/names of custom blocks and items) with DisableResourceBuilding and use a hand-written resource pack. It is easy to fix and test the pack separately, and you can open models directly in Blockbench. The resource pack holds block and item textures and atlases, block models, names (texts/ko_KR.lang, en_US.lang: item.<id>.name, tile.<id>.name), entity models, animations, sounds, JSON UI and particles.

  • Use a single identifier namespace (custom:).
  • Tests check that what server code refers to by name (model identifiers, material texture keys, item icons, name lines) exists in the pack. For item names, the Go Name() and the lang line must match.
  • Vanilla blocks Dragonfly lacks: piston, observer, dispenser, dropper, repeater, comparator. Some it has are hopper, chest, furnace, redstone dust, torch and lever. If you need a missing device, build it as a custom block.

UI methods​

MethodUse
Ore UI DDUI screenMenus, settings. Up to 26.63 the pack's hbui/ replaced Ore UI pages during play. In 26.64 resource pack access to Ore UI was blocked
Decorating forms with JSON UIEdit the RP's ui/server_form.json and so on to make menus look like game UI. A common approach is to put a marker in the form title to choose the layout per screen
Chest-style inventory UIInventory viewing, block workstation windows. Open an invisible entity as a chest (fake-blocks-and-chunks.mdx)
Sidebar, boss bar, title, action barQuest windows and HUD. Supported by the Dragonfly API

What was confirmed about client display (server development notes)​

  • Translation key in an item name {measured}: When a translation key was put in an item's custom name and description (lore), the client tooltip showed it literally. This was the same for item.diamond.name, %item.diamond.name and %item.diamond.name%, whether the key was the whole line or in the middle of text (1.26.50).
  • Legacy translation keys {record}: Many blocks do not find their name through tile.<modern ID>.name. The names are under legacy keys (oak_planks is tile.planks.oak.name, oak_sapling is tile.sapling.oak.name). If sent as is, the key text or the identifier shows. You can build a table by converting the ID to title form ("Oak Planks") and pairing it with the English value in bedrock-samples' en_US.lang, and about 190 (Education Edition, test blocks, element_* and so on) have no match.
  • Language fallback {record}: On the client, en_US.lang is the fallback for every other language. Put the pack's block and item names in en_US.lang too.
  • Held pose {record}: Sticks and bones are drawn in a tool-like grip in the third-person hand, but vanilla data has no minecraft:hand_equipped (component_based 0). It is hard-coded in client code. In the data (vanilla_items.nbt, bedrock-samples behavior_pack/items), only breeze_rod and spears (*_spear) have this component set to true. Bamboo was also drawn slanted in the hand like a stick {measured} (2026-11-10). The blaze rod is only assumed to belong to the same group and was not checked {unverified}.
  • x axis of custom block boxes {measured} (2026-11-05): the selection and collision boxes a server sends for a custom block are read in the block geometry's space, whose x axis is mirrored against the world's. For asymmetric shapes (east and west variants), send the boxes mirrored in x so they match the drawn model.
  • The inventory icon is the first state {measured} (2026-11-05): the client draws a custom block's first state (permutation) as its block item in the inventory. Put the shape the item should show in state 0.
  • Zero-size boxes {code (binary)} (not yet checked in game): a collision or selection box with all values zero is read as "not set", and the client uses the full cube. To make a block that the player and crosshair pass through without a patch, send both boxes with zero size placed at the cell's middle. The alternative is sending minecraft:collision_box and minecraft:selection_box with enabled: false, which needs a Dragonfly patch.
  • Showing an item in front of a block {record}: Item entities always spin and bob on the client, merge with nearby identical items, and get sucked into a hopper below. Use a custom entity that holds the item in its hand (MobEquipment, enable_attachables) instead.
    • The bone structure is root > body > rightarm > rightitem_pose > rightitem_handheld > rightitem and body > leftarm > leftitem. The values that cancel the third-person hand pose are rightitem_pose pivot [-1, -6, -6], rotation [-75, -12, -16], and leftitem pivot [5.5, 1, -3], rotation [-20, 45, 0] (see the Storage Drawers Bedrock add-on).
    • An entity can look at the main hand item with query.is_item_name_any('slot.weapon.mainhand', 0, ...) and rotate only the held-pose items separately to correct them. The third-person item transform values are not in public material, and scale 0.65 fit for sticks.
    • A client entity texture cannot be chosen per item (the render controller array and variant values would be needed for as many items as there are).
    • Full cube blocks are drawn in 3D in the hand, so the angle differs. Cube blocks were fitted in the off hand and everything else in the main hand.
  • Break cracks and particles {record}: The client draws break cracks and particles on the block geometry cube. If the cube is small or transparent they are not visible, and the particles take their color from texture pixels.
  • Block item picture {record}: A block item is drawn in the shape of the block in inventories and forms, and scaled up to fill the slot. To make it appear at 9/16 size, put it inside a transparent 16-pixel frame cube. In inventories the south face is visible, so put the front on the south. The item icon texture is not required.
  • Block state order {record}: The client matches block runtime IDs in block state order. If you merge the state into one number, the order cannot drift from the server.
  • Entity model orientation {record}: Entity models are drawn half a turn from the world (the model's front faces north). When converting world coordinates to model coordinates, flip only the sign of z and leave x as it is.
  • Block texture animation {docs, record}: One entry in textures/flipbook_textures.json animates one tile of terrain_texture.json. The image is a vertical strip (width 16, height 16 x frame count) and takes ticks_per_frame, frames (an ordered array) and blend_frames (on by default). A custom block animates with no other component if the texture in material_instances is that tile. The two files are merged across packs. All blocks animate at the same tempo, and switching it on and off is done by changing the texture through block state permutations. In item icons it does not animate depending on the version (Bedrock Wiki).
  • Interactive blocks {record}: On top of a block the server sent as an interactive block (Dragonfly Activatable), the client does not predict placing the block it holds.
  • Debug shape text direction {record}: Rotation of a debug shape is [pitch, yaw, roll] in degrees, and yaw 0 reads from north. The reference differs from entity yaw (south 0, north 180), so using it as is flips north and south. A value in radians is effectively 0 degrees.
Sources
idSourceLicenseCommitAccessed
private-researchPrivate research (-)-2026-11-13
dragonflyDragonfly (df-mc)MITd86aefd (baseline of a patch for one Dragonfly-based server)2026-11-13
bedrock-samplesMojang bedrock-samplesMinecraft EULA applies, (c) Mojang AB. All rights reserved15701fa9 (guide baseline 46ba6ea)2026-11-13