Bedrock Wiki
  • Discord
  • Contribute
  • bedrock.dev
  • MS Learn
Beginner's Guide
  • Guide
    • 1. Introduction
      guide
    • 2. Add-Ons Explained
    • 3. Software & Preparation
    • 4. Project Setup
    • 5. Create a Custom Item
    • 6. Create a Custom Entity
    • 7. Blockbench: Modeling, Texturing & Animating
    • 8. Adding a Loot Table, Spawn Rule & Crafting Recipe
  • Extra
    • a. Understanding JSON
    • b. Download Example Packs
    • c. Troubleshooting
      help
    • d. Advanced Manifest
    • e. Format Versions
    • f. Project Setup Android
Animation Controllers
  • Intro to Animation Controllers
    guide
  • Entity Commands
  • AFK Detector
  • Death Commands
  • Molang into Scoreboard
  • Respawn Commands
Blocks
  • General
    • Intro to Blocks
      guide
    • Block Components
    • Block Tags
    • Block States
    • Block Traits
    • Block Permutations
    • Block Events
      Scripts
    • Block Event Migration
      help
    • Blocks as Items
    • Troubleshooting Blocks
      help
  • Visuals
    • Block Culling
    • Block Models
      guide
    • Block Texture Animation
    • Block Texture Variation
    • Block Tinting
  • Tutorials
    • Applying Effects
      Scripts
    • Avoiding State Limit
    • Fake Blocks
      Scripts
    • Ore Loot Tables
      Scripts
    • Precise Rotation
      Scripts
    • Rotatable Blocks
    • Tool-Based Destruction
  • Vanilla Re-Creations
    • Custom Crops
      Scripts
    • Custom Glass
    • Custom Glazed Terracotta
    • Custom Trapdoors
      Scripts
  • Documentation
    • Block Format History
    • Block Shapes
    • Block Sounds
    • Redstone Components
    • Vanilla Block Models
Commands
  • General
    • Intro to Command Blocks
    • Functions
    • Block States
    • Coordinate System
    • Giving NBT Items
    • Scoreboard Operations
    • Understanding Selectors
  • Commands
    • Damage
    • Execute
    • Playanimation
    • Playsound
  • On Event Systems
    • On First World Load
    • On Player First Join
    • On Player Join
    • On Player Leave
    • On Player Death
    • On Player Respawn
  • Scoreboard Systems
    • Entity Counter
    • Scoreboard Timers
    • Comparing And Retrieving Scores
  • Techniques
    • Execute Logic Gates
    • Execute at Block Variant
    • MBE - Max's Block Entity
    • FMBE - A New Way to Create Display Entities
    • Item Drop Detection
    • Look Detection
    • Movement Detections
    • Orbital Camera
  • Useful Creations
    • Compass Display
    • Custom Crafter
    • Multiplayer Position Rearrangement
      function
Concepts
  • contents.json
  • Molang
  • Namespaces
  • Overwriting Assets
  • Shaders
  • Sounds
  • Subpacks
  • Texture Atlases
  • textures_list.json
Documentation
  • Advanced Molang
  • File Types
  • Fog IDs
  • Material Configuration Description
  • Menu Categories
  • Molang Queries
  • Pack Folder Structure
  • Shared Constructs
  • Sound Definitions
  • Vanilla Materials
Entities
  • General
    • Intro to Entities BP
      guide
    • Intro to Entities RP
      guide
    • Troubleshooting Entities
      help
    • Entity Events
    • Entity Properties
    • NPC Dialogue
    • Render Controllers
    • Spawn Rules
  • Tutorials
    • Convert Points Between Any Space (World, Entity, Bones)
    • Creating Boats
    • Detecting Other Entities
    • Disabling Team Damage
    • Dummy Entities
    • Entity Attacks
    • Entity Holds Item
    • Entity Movement
    • Entity Timers
    • Introduction to AOE Clouds
    • Invulnerable Entities
    • Look at Entity
    • Riding Flying Entities
    • Sleeping Entities
    • Solid Entities
    • Spawning Tamed Entities
      Scripts
    • Village Mechanic
  • Documentation
    • Dummy Components
    • Non-Mob Runtime Identifiers
    • Projectiles
    • Runtime Identifiers
    • Vanilla Usage Components
    • Vanilla Usage Spawn Rules
Items
  • General
    • Intro to Items
      guide
    • Item Components
    • Item Tags
    • Item Events
      Scripts
    • Item Event Migration
      help
    • Troubleshooting Items
      help
  • Tutorials
    • Custom Armor
    • Custom Food
      Scripts
    • Custom Pottery Sherds
    • Custom Weapons
    • Equipment-Based Commands
    • High Resolution Items
    • Spawning Items
    • Throwable Items
  • Documentation
    • Enchantments
    • Attachables
    • Item Format History
    • Numerical Item IDs
    • Vanilla Usage Components
JSON UI
  • General
    • Intro to JSON UI
      guide
    • Best Practices
      guide
  • Tutorials
    • Adding HUD Elements
    • Aseprite Animations
    • Buttons and Toggles
    • Modifying Server Forms
    • Preserve Title Texts
    • String to Number
  • Documentation
    • JSON UI Documentation
Loot, Recipes & Trading
  • General
    • Trading Behavior
  • Documentation
    • Loot Tables
    • Trade Tables
    • Recipes
    • Item Functions
  • Tutorials
    • Randomized Structure Loot
Meta
  • Add-On Performance
  • Style Guide
  • Useful Links
  • Using Schemas
  • Version Control
  • Q&A
    • Blocks and Items Q&A 2024/08/30
    • Deferred Technical Preview Q&A 2024/02/23
    • GameTest Q&A 2021/08/06
    • Scripting and Editor Q&A 2023/09/22
    • World Generation Q&A 2024/11/15
NBT
  • General
    • .mcstructure
  • Tutorials
    • Enabling Experiments by Editing NBT
    • Extending Structure Limits
  • NBT in Depth
    • About NBT (Named Binary Tag)
    • NBT Libraries
    • Reading NBT Example
Particles
  • General
    • Intro to Particles
      guide
  • Tutorials
    • Disabling Particles
  • Documentation
    • Vanilla Particles
Scripting
  • General
    • Intro to Scripting
    • What is Script API?
    • API Modules
  • Tutorials
    • Block Placement Prevention
    • Custom Commands
    • GameTests
    • Script Core Features
    • Script Forms
    • Script Privileges
    • Script Requests API
  • Documentation
    • Engine Environment
    • Script Resources
    • Script Watchdog
    • Troubleshooting JavaScript
    • TypeScript
Servers
  • Software
    • Bedrock Server Software
  • Protocols
    • Bedrock Protocol
    • NetherNet Protocol
    • RakNet Protocol
Text & Localization
  • General
    • Intro to Text & Localization
    • Raw Text
    • Splashes
  • Emojis & Symbols
    • Fonts
    • Intro to Emojis
    • Custom Emojis
    • Input Keys
Visuals
  • General
    • Introduction to Entity Visuals
      guide
    • Bedrock Modeling
    • Custom Death Animations
    • Effects in Animations
    • Material Creations
    • Materials
    • Math-Based Animations
    • Skin Packs
  • Tutorials
    • Entity Texture Animation
    • Glowing Entity Texture
    • Hurt Animations
    • Leash Position
    • Player Geometry
    • Remove Entity Shadows
    • Retexturing Spawn Eggs
  • Ideas
    • Structure Presentation
World Generation
  • General
    • Intro to World Generation
      guide
    • Biomes
      guide
    • Feature Types
    • Jigsaw Structures
  • Tutorials
    • Block Conditions for Features
    • Generating Custom Ores
    • Generating Custom Structures
    • Generating Patches
    • Heightmap Noise
  • Documentation
    • Biome Tags

Tool-Based Destruction

intermediate
Tool-Based Destruction
  • Before You Start
  • Block Hardness
    • Defining Block Hardness
    • Defining Suitable Tools
  • Tool-Based Drops
    • Loot Table
    • Mining Penalty
    • Tier Destructible Tags
  • Bad Practices

FORMAT VERSION 1.21.120

This tutorial assumes a basic understanding of blocks and block tags. Check out the blocks guide before starting.

Before You Start ​

Unfortunately, the destructible by mining component has extremely inaccurate parameter names which makes tool-based destruction (and block destruction overall) especially confusing.

For you to follow this tutorial properly, make sure you understand the following:

  • The seconds_to_destroy parameter does not represent the number of seconds it takes to destroy the block.

    This parameter actually defines the block's hardness value, which is used as the base value to determine a block's mining duration.

  • The destroy_speed parameter of item_specific_speeds does not represent the speed of the block's destruction.

    If it were the measure of speed that its name implies, higher values (indicating a faster speed) would result in shorter mining durations, however higher values instead increase mining duration.

    This parameter actually defines the block's hardness value (the same as seconds_to_destroy) when it is being mined by the specified item.

On this page, we will be referring to the value that seconds_to_destroy and destroy_speed represent using the word hardness (which is the correct terminology).

Block Hardness ​

Defining Block Hardness ​

A block's hardness value is set using the destructible by mining component. By default a block's hardness is 0, meaning it can be mined instantly.

minecraft:block > components
json
"minecraft:destructible_by_mining": {
    "seconds_to_destroy": 2 // Sets the block's hardness to 2
}
1
2
3

Here are some hardness values used by vanilla blocks:

  • Dirt: 0.5
  • Stone: 1.5
  • Planks: 2

You can find other hardness values on the Minecraft Wiki.

Defining Suitable Tools ​

There are currently 6 item destructible vanilla block tags:

  • Axes: minecraft:is_axe_item_destructible
  • Hoes: minecraft:is_hoe_item_destructible
  • Pickaxes: minecraft:is_pickaxe_item_destructible
  • Shears: minecraft:is_shears_item_destructible (not functional, see MCPE-189586)
  • Shovels: minecraft:is_shovel_item_destructible
  • Swords: minecraft:is_sword_item_destructible (not functional, see MCPE-189586)

Applying one of these tags to your block will instruct the relevant tools to mine the block faster.

MULTIPLE TOOLS

Blocks aren't limited to just one item destructible tag, it's possible to let your block be mined faster by multiple types of tool!

This can be seen in vanilla Cobwebs which have both minecraft:is_shears_item_destructible and minecraft:is_sword_item_destructible.

These tags can be applied to your block in its components:

BP/blocks/custom_stone.json
json
{
    "format_version": "1.21.120",
    "minecraft:block": {
        "description": {
            "identifier": "wiki:limestone",
            "menu_category": {
                "category": "nature",
                "group": "minecraft:itemGroup.name.stone"
            }
        },
        "components": {
            "minecraft:destructible_by_mining": {
                "seconds_to_destroy": 1.5
            },
            // Allows pickaxes to mine this block faster
            "tag:minecraft:is_pickaxe_item_destructible": {}
        }
    }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

Tool-Based Drops ​

UNSUPPORTED

There is no proper way to specify which tools are required for a block to drop loot. The following section describes workarounds that can be used to replicate vanilla drop mechanics as well as possible.

SILK TOUCH

It is impossible to prevent a block from dropping itself when mined using an item with the Silk Touch enchantment.

In order to prevent your block from dropping when destroyed without the required tool, you'll need to create a new loot table.

minecraft:block > components
json
"minecraft:loot": "loot_tables/wiki/blocks/limestone.json"
1

Loot Table ​

You can then use the match_tool condition to test for certain tool items, such as a pickaxe that is iron tier or higher.

Similarly to the destructible by mining component, the match_tool parameters are poorly named as they do not indicate the aspect of the tool that their filtering is based on. Here's a better description of what each filter parameter does:

  • minecraft:match_tool_filter_all checks that the item has all of the listed tags.
  • minecraft:match_tool_filter_any checks that the item has at least one of the listed tags.
  • minecraft:match_tool_filter_none checks that the item has none of the listed tags.

EXCLUDING EMPTY HANDS

By default, the match_tool component will match an empty hand. To prevent this from happening, you'll need to ensure that the stack size (count) is not 0.

BP/loot_tables/wiki/blocks/limestone.json
json
{
    "pools": [
        {
            "rolls": 1,
            "conditions": [
                {
                    "condition": "match_tool",
                    "count": 1, // Ensures that the hand is not empty
                    "minecraft:match_tool_filter_all": [
                        "minecraft:is_tool",
                        "minecraft:is_pickaxe" // Change this tag based on the tool type that must be used.
                    ],
                    // A list of the tool tiers that can successfully mine the block.
                    // If your block should drop regardless of the tool's tier, you should remove this filter rather than listing every tier.
                    "minecraft:match_tool_filter_any": [
                        "minecraft:iron_tier",
                        "minecraft:diamond_tier",
                        "minecraft:netherite_tier"
                    ]
                }
            ],
            "entries": [
                {
                    "type": "item",
                    "name": "wiki:limestone"
                }
            ]
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

Mining Penalty ​

Block destroy speed is supposed to be over 3 times slower when using a tool that is not correct for drops. However, given that custom blocks have no way to properly define the tool they require to drop, this mining penalty is not applied.

We can replicate this penalty by making the hardness of the block 3.33× higher than it should be when the correct tool is not being used. This can be achieved by using the item_specific_speeds parameter of the destructible by mining component.

minecraft:block > components
json
"minecraft:destructible_by_mining": {
    "seconds_to_destroy": 6.66, // Hardness when not using tool (2 × 3.33 = 6.66)
    "item_specific_speeds": [
        {
            "destroy_speed": 2, // Hardness when using tool
            "item": {
                "tags": "q.all_tags('minecraft:is_tool', 'minecraft:is_pickaxe') && q.any_tag('minecraft:iron_tier', 'minecraft:diamond_tier', 'minecraft:netherite_tier')"
            }
        }
    ]
}
1
2
3
4
5
6
7
8
9
10
11

Tier Destructible Tags ​

There are also several tier destructible vanilla block tags that indicate the tier of tool required for the block to drop. While adding one of these tags to your block does not come with changes in block functionality (such as preventing drops without a custom loot table), the appropriate tag should be added to your block to be consistent with vanilla blocks.

  • Stone or better: minecraft:stone_tier_destructible
  • Iron or better: minecraft:iron_tier_destructible
  • Diamond or better: minecraft:diamond_tier_destructible

Bad Practices ​

  • Do not use item_specific_speeds to individually define a hardness value for each tool item.

    This will prevent the Efficiency enchantment and custom tools from affecting your block and will make your JSON unnecessarily long. You should always use the minecraft:is_*_item_destructible tags instead.

Contributors

Edit Tool-Based Destruction on GitHub

Text and image content on this page is licensed under the Creative Commons Attribution 4.0 International License

Code samples on this page are licensed under the MIT License

Bedrock Wiki by Bedrock OSS

"Minecraft" is a trademark of Mojang AB.

Bedrock OSS, Bedrock Wiki and bedrock.dev are not affiliated in any way with Microsoft or Mojang AB.

  • Privacy Policy
  • Join our Discord
  • Learn how to Contribute
  • Visit our Repository