Wiki 9Minecraft Wiki 9Minecraft

Create a Custom Dispenser Behavior for a Specific Item

Java EditionModGuides 4FAQ 10Related mods 48
DownloadDispenser Configurator Mod

Get the files on 9Minecraft

Contents (3)
  1. Setting Up Your Configuration File
  2. Defining Item Behavior
  3. Example Structure

Setting Up Your Configuration File

Dispenser Configurator uses JSON data packs to define custom behaviors. Create a new data pack in your world's datapacks folder, then add a configuration file in the structure: data/namespace/dispenser_config/items/your_item.json.

Defining Item Behavior

In your JSON file, specify:

  • item: The item ID you want to configure (e.g., minecraft:diamond_pickaxe)
  • usage_type: How the dispenser should use it—common types include ITEM_USE (right-click behavior) or BLOCK_USE (block interaction)
  • targets: A list defining what happens when dispensed. Each target can specify block types, positions, or conditions the item should interact with

Example Structure

Your configuration might look like:

`json

{

"item": "minecraft:bone_meal",

"usage_type": "ITEM_USE",

"targets": [

{"type": "block", "blocks": ["minecraft:grass"]}

]

}

`

Reload your data pack with /reload to apply changes. Test by placing the configured item in a dispenser and powering it.

More guides for this mod