Wiki 9Minecraft Wiki 9Minecraft

Vanilla Item Usage Components Reference

Add eating, throwing, block placing, and repair mechanics to custom items using built-in components.

5Sections
4Code examples
4Known errors

Vanilla usage components let your custom items tap directly into built-in Minecraft mechanics without writing Script API code. When you need an item to be eaten like food, thrown like a snowball, placed as a block, or repaired at an anvil, you attach these components inside your behavior pack item JSON. They handle animations, sounds, stack consumption, and cooldowns automatically.

Consumables and Food

Making an item edible requires three components working together. While minecraft:food defines the nutrition and saturation restored to the player, the item cannot actually be eaten in-game unless you also give it a use animation and a use duration.

The minecraft:use_modifiers component controls how long the player must hold the use button before the item is consumed, as well as how much their movement speed is reduced while using it. The minecraft:use_animation component tells the client which animation and sound set to play—typically eat or drink.

FieldWhat it doesNotes
nutritionHalf-drumsticks of hunger restoredInteger value; 2 equals one full icon on the hunger bar.
saturation_modifierControls hidden saturation restoredFloat between 0.0 and 1.0+. Higher values delay hunger drain longer.
can_always_eatAllows eating with a full hunger barDefaults to false. Useful for golden apples or buff items.
using_converts_toItem returned after consumptionAccepts an item identifier string, such as a bowl or glass bottle.
BP/items/spiced_apple.json
{
  "format_version": "1.20.50",
  "minecraft:item": {
    "description": {
      "identifier": "my_pack:spiced_apple",
      "menu_category": {
        "category": "equipment",
        "group": "itemGroup.name.miscFood"
      }
    },
    "components": {
      "minecraft:icon": "spiced_apple",
      "minecraft:use_animation": "eat",
      "minecraft:use_modifiers": {
        "use_duration": 1.6,
        "movement_modifier": 0.35
      },
      "minecraft:food": {
        "nutrition": 6,
        "saturation_modifier": 0.6,
        "can_always_eat": false,
        "using_converts_to": "minecraft:stick"
      }
    }
  }
}

Throwables and Projectiles

To create an item that launches an entity—such as a custom snowball, kunai, or splash potion—pair minecraft:throwable with minecraft:projectile. The throwable component handles the player input (either a quick right-click or a charge-and-release gesture), while the projectile component dictates which entity identifier is spawned into the world.

Note that the entity you reference in projectile_entity must already exist in your behavior pack (or be a vanilla projectile) and have its own minecraft:projectile entity component configured to actually fly and deal damage.

BP/items/pebble.json
{
  "format_version": "1.20.50",
  "minecraft:item": {
    "description": {
      "identifier": "my_pack:pebble",
      "menu_category": {
        "category": "equipment"
      }
    },
    "components": {
      "minecraft:icon": "pebble",
      "minecraft:max_stack_size": 16,
      "minecraft:Cooldown": {
        "category": "pebble_throw",
        "duration": 0.5
      },
      "minecraft:throwable": {
        "do_swing_animation": true,
        "launch_power_scale": 1.0,
        "max_draw_duration": 0.0,
        "min_draw_duration": 0.0,
        "scale_power_by_draw_duration": false
      },
      "minecraft:projectile": {
        "minimum_critical_power": 1.0,
        "projectile_entity": "minecraft:snowball"
      }
    }
  }
}

Placing Blocks and Spawning Entities

When an item needs to place a block or spawn a mob when used against a block face, use minecraft:block_placer or minecraft:entity_placer. Both components allow you to restrict which surfaces the item will work on using the use_on array. This is how vanilla seeds restrict themselves to farmland.

If you use minecraft:block_placer on a custom item to place a custom block, it replaces the block's default auto-generated item when the identifiers match, or acts as a separate seed/placer item when the identifiers differ.

ComponentKey FieldsNotes
minecraft:block_placerblock, use_onConsumes 1 item from the stack in Survival mode when the block is placed.
minecraft:entity_placerentity, use_on, dispense_onSpawns the specified entity identifier. Also configures dispenser behavior via dispense_on.
BP/items/tomato_seeds.json
{
  "format_version": "1.20.50",
  "minecraft:item": {
    "description": {
      "identifier": "my_pack:tomato_seeds"
    },
    "components": {
      "minecraft:icon": "tomato_seeds",
      "minecraft:block_placer": {
        "block": "my_pack:tomato_crop",
        "use_on": [
          "minecraft:farmland"
        ]
      }
    }
  }
}

Durability and Anvil Repair

Items that take damage during use need minecraft:durability. By itself, this component only gives the item a durability bar and a maximum health pool; another mechanic (such as minecraft:digger, weapon combat, or a custom script) must actually apply the damage.

To let players maintain that durability at an anvil, add minecraft:repairable. You can define multiple repair entries, mixing raw materials (like ingots) with self-repair (combining two damaged copies of the same item). The repair_amount field accepts plain integers as well as Molang expressions.

BP/items/copper_chisel.json
{
  "format_version": "1.20.50",
  "minecraft:item": {
    "description": {
      "identifier": "my_pack:copper_chisel"
    },
    "components": {
      "minecraft:icon": "copper_chisel",
      "minecraft:max_stack_size": 1,
      "minecraft:durability": {
        "max_durability": 180,
        "damage_chance": {
          "min": 60,
          "max": 100
        }
      },
      "minecraft:repairable": {
        "repair_items": [
          {
            "items": [
              "minecraft:copper_ingot"
            ],
            "repair_amount": 45
          },
          {
            "items": [
              "my_pack:copper_chisel"
            ],
            "repair_amount": "context.other->query.remaining_durability + 0.05 * context.other->query.max_durability"
          }
        ]
      }
    }
  }
}

Cooldowns and Fuel

Two smaller utility components frequently accompany the usage components above: minecraft:cooldown and minecraft:fuel. The cooldown component prevents the player from activating the item again for a set duration (in seconds), rendering the familiar white sweeping overlay on the hotbar icon. Any items that share the same category string will enter cooldown simultaneously, just like vanilla Ender Pearls or Chorus Fruit.

The minecraft:fuel component has only one field, duration, measured in seconds. An item with a duration of 10.0 will smelt exactly one item in a standard furnace. You can safely combine fuel with food, block placers, or tools.

ComponentFieldNotes
minecraft:cooldowncategory (string), duration (float)Triggered automatically by food consumption and throwable launches.
minecraft:fuelduration (float)Burn time in seconds. Coal is 80.0; a wooden plank is 15.0; a stick is 5.0.

Which versions this applies to

Applies to format_version 1.20.50 and newer (including 1.21.x). All components on this page are stable and do not require any experimental toggles.

When it does not work

What you seeWhyThe fix
Player right-clicks with a custom food item and nothing happens—no eating animation plays and hunger is not restored.In modern format versions, minecraft:food only holds nutrition data. The item does not know how long the use action takes unless minecraft:use_modifiers is also present with a use_duration greater than zero.Add "minecraft:use_modifiers": { "use_duration": 1.6 } and "minecraft:use_animation": "eat" alongside your minecraft:food component.
Content Log Error: [Item][error] my_pack:pebble | minecraft:cooldown: Unknown component.Component identifiers are strictly lowercase. In the pebble example or your own code, writing "minecraft:Cooldown" with a capital C causes the schema parser to reject the component.Change the key to lowercase "minecraft:cooldown".
Throwable item requires the player to hold right-click before it fires on release, instead of throwing immediately on click like a snowball.scale_power_by_draw_duration is set to true or max_draw_duration is greater than 0.0, which puts the item into bow-like charge mode.Set "max_draw_duration": 0.0, "min_draw_duration": 0.0, and "scale_power_by_draw_duration": false inside minecraft:throwable for instant throws.
Content Log Warning: saturation_modifier in minecraft:food only accepts string values ('poor', 'low', 'normal', etc.) or vice versa.You mixed an older format_version (such as 1.16.100 or 1.20.10) with modern syntax, or used string literals in a 1.20.50+ file.Ensure your item file's format_version is 1.20.50 or higher and pass a float (like 0.6) to saturation_modifier.

Reference, straight from the game files

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