Wiki 9Minecraft Wiki 9Minecraft

Allowing Custom Entities to Hold Items

Configure geometry, client entity files, and behaviors so custom mobs can equip and render held items.

5Sections
3Code examples
3Known errors

Allowing a custom entity to visibly hold weapons, tools, or blocks in its hands requires coordination across your resource pack and behavior pack. Simply equipping an item via behavior components or commands will not make it appear in the world unless the entity's model has a designated attachment bone and the client entity file instructs the renderer to draw the item. You will use this setup whenever you create custom humanoid mobs, guards, traders, or companions that need to display their active gear to players.

How Item Rendering Works in Bedrock

In Minecraft Bedrock, an entity holding an item is split into two completely separate systems: the server-side inventory state and the client-side visual rendering. On the server (behavior pack), the entity stores what item is currently in its mainhand or offhand slot, along with any weapon stats or durability. On the client (resource pack), the game engine checks if that entity is allowed to render held items and looks for a specific bone in the geometry to attach the item model to.

Because these systems are decoupled, a bug in your resource pack will result in a mob that hits with the strength of a diamond sword while appearing completely empty-handed. Conversely, if the geometry bone is misaligned, the item may render floating several blocks away from the mob's body. Setting this up properly requires touching three files: the geometry JSON, the client entity JSON, and the server entity JSON.

Preparing the Geometry Bone

The Bedrock item renderer does not guess where your entity's hands are. Instead, it searches the entity's geometry for a bone named `rightItem` (case-sensitive) to attach mainhand items, and `leftItem` for offhand items. This bone does not need any cubes of its own; it acts purely as a pivot and attachment point.

When modeling in Blockbench, create an empty bone named `rightItem` as a child of your entity's right arm bone. Position the pivot point of `rightItem` right where the palm or grip of the hand is located. For standard humanoid proportions matching the vanilla player or zombie, placing the pivot near the bottom tip of the right arm ensures that swords and tools rotate naturally from the wrist when the arm swings.

RP/models/entity/custom_guard.geo.json
{
  "format_version": "1.12.0",
  "minecraft:geometry": [
    {
      "description": {
        "identifier": "geometry.custom_guard",
        "texture_width": 64,
        "texture_height": 64,
        "visible_bounds_width": 2,
        "visible_bounds_height": 3,
        "visible_bounds_offset": [0, 1.5, 0]
      },
      "bones": [
        {
          "name": "root",
          "pivot": [0, 0, 0]
        },
        {
          "name": "body",
          "parent": "root",
          "pivot": [0, 24, 0],
          "cubes": [
            {"origin": [-4, 12, -2], "size": [8, 12, 4], "uv": [16, 16]}
          ]
        },
        {
          "name": "rightArm",
          "parent": "body",
          "pivot": [-5, 22, 0],
          "cubes": [
            {"origin": [-8, 12, -2], "size": [4, 12, 4], "uv": [40, 16]}
          ]
        },
        {
          "name": "rightItem",
          "parent": "rightArm",
          "pivot": [-6, 15, 1]
        }
      ]
    }
  ]
}

Enabling Item Rendering in the Client Entity

Even with the `rightItem` bone present in your geometry, the engine will not render anything in the mob's hand until you enable the `enable_attachables` flag in the client entity definition (`RP/entity/`). Despite the name suggesting it only applies to attachable armor and custom 3D items, `enable_attachables` is the master switch that allows an entity to render standard held items, weapons, and armor pieces.

If your entity holds custom 3D items that rely on vanilla hold animations (such as bows, crossbows, or tridents), your client entity must also declare the animation keys that those attachables expect, such as `c.is_first_person` or specific hold poses. For standard melee weapons and blocks, simply enabling attachables is sufficient.

RP/entity/custom_guard.entity.json
{
  "format_version": "1.10.0",
  "minecraft:client_entity": {
    "description": {
      "identifier": "wiki:custom_guard",
      "materials": {
        "default": "entity_alphatest"
      },
      "textures": {
        "default": "textures/entity/custom_guard"
      },
      "geometry": {
        "default": "geometry.custom_guard"
      },
      "render_controllers": [
        "controller.render.default"
      ],
      "enable_attachables": true
    }
  }
}

Assigning and Picking Up Items in the Behavior Pack

With the visuals ready, you must give the entity an item on the server side. There are three primary ways a custom entity acquires a held item: spawning with gear via a loot table, picking up dropped items from the ground, or receiving an item directly via the `/replaceitem` command.

To spawn the entity with a weapon already in its hand, add the `minecraft:equipment` component pointing to a loot table. When the loot table rolls a weapon or tool, the entity automatically equips it into its mainhand slot. If you want the mob to pick up better weapons it finds on the ground during gameplay, combine `minecraft:equip_item` with `minecraft:shareables` and `minecraft:behavior.pickup_items`.

ComponentWhat it doesNotes
minecraft:equipmentRolls a loot table upon spawning and equips the resulting items.Weapons default to the mainhand; armor pieces go to their respective armor slots.
minecraft:equip_itemAllows the entity to put picked-up items into its equipment slots.Must be paired with pickup behaviors to work dynamically in the world.
minecraft:shareablesDefines a list of items the entity wants to pick up or barter for.Lower priority numbers mean higher preference when choosing between items.
minecraft:behavior.pickup_itemsAI goal that makes the entity walk over to dropped items and collect them.Respects the filter list defined in minecraft:shareables.
BP/entities/custom_guard.json
{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "wiki:custom_guard",
      "is_spawnable": true,
      "is_summonable": true
    },
    "components": {
      "minecraft:physics": {},
      "minecraft:health": {
        "value": 20,
        "max": 20
      },
      "minecraft:equipment": {
        "table": "loot_tables/entities/guard_gear.json"
      },
      "minecraft:equip_item": {},
      "minecraft:shareables": {
        "items": [
          {
            "item": "minecraft:iron_sword",
            "priority": 0,
            "max_amount": 1
          }
        ]
      },
      "minecraft:behavior.pickup_items": {
        "priority": 2,
        "max_dist": 3.0,
        "speed_multiplier": 1.0
      }
    }
  }
}

Testing Held Items with Commands and Molang

During development, you do not need to write loot tables just to verify your `rightItem` bone positioning. Summon your custom entity in-game and run `/replaceitem entity @e[type=wiki:custom_guard,c=1] slot.weapon.mainhand 0 iron_sword`. The sword should immediately appear in the entity's hand.

If you want your entity to change its posture when holding an item—such as raising its arm like a vindicator or aiming with two hands—you can check whether the hand is occupied using Molang inside an animation controller or render controller. Use the query `q.is_item_equipped(0)` (or `query.is_item_equipped('main_hand')`) to return `1.0` when an item is in the mainhand, and `0.0` when the hand is empty.

Which versions this applies to

Applies to Minecraft Bedrock 1.10.0 and above. The `enable_attachables` client entity property works in format_version 1.10.0+. No experimental toggles are required.

When it does not work

What you seeWhyThe fix
The entity deals extra melee damage from its equipped sword, or `/replaceitem` reports success, but the hand remains visually empty.Either `"enable_attachables": true` is missing from the client entity description, or the geometry bone is named something like `right_item` or `RightItem` instead of the exact camelCase `rightItem`.Open your `.geo.json` file and verify the bone name is exactly `rightItem`, then check your `RP/entity/` file and ensure `"enable_attachables": true` is inside the `description` object.
The held item renders on the ground between the mob's feet and does not move when the mob swings its arm.The `rightItem` bone in your geometry file is placed at the root level with a pivot of `[0, 0, 0]` instead of being parented to the right arm bone.In Blockbench or your `.geo.json` file, set `"parent": "rightArm"` (matching your arm bone's name) on the `rightItem` bone, and move its pivot point to the hand's grip location.
Held swords and axes point backward or sideways out of the mob's wrist.The parent arm bone or the `rightItem` bone itself has baked rotation values in the geometry or idle animation that conflict with Bedrock's default item attachment orientation.Reset the rotation of `rightItem` to `[0, 0, 0]` in the base geometry, or apply a corrective rotation directly to the `rightItem` bone inside your entity's idle pose animation.

Reference, straight from the game files

Read out of the game itself, so the ids match the version you are building for.