Skip to content

How to make a block need a certain tool in a Minecraft mod

Which tool mines a block fast is a tag: minecraft:mineable/pickaxe, axe, shovel or hoe. Which tier it needs is another tag: needs_stone_tool, needs_iron_tool, needs_diamond_tool. Both are files under data/minecraft/tags/block (tags/blocks before 1.21) that list your block. The block’s properties also need requiresCorrectToolForDrops(), or it drops with any tool.

Works on Minecraft 1.20.1 to 26.3 on NeoForge; Minecraft 1.17.1 to 1.20.1 on Forge; Minecraft 1.17 to 26.3 on Fabric. Each example was compiled against its loader and version before it shipped in Linen.

  1. Add .requiresCorrectToolForDrops() to the block’s properties.
  2. List the block in the mineable tag for its tool.
  3. List it in the needs_<tier>_tool tag.
  4. Try breaking it with the wrong tool, then the right one.

The example uses these values. Change them in the code.

Setting In the example What it does
tool_tag mineable/pickaxe The tool that mines it fast.
tier_tag needs_iron_tool The tier it needs.

The example mod is examplemod in the package com.example.examplemod. Use your own mod id and package.

Fabric and NeoForge 1.20.4 to 1.20.6, NeoForge 1.20.1 to 1.20.2, Fabric 1.17 to 1.20.3, Forge 1.17.1 to 1.20.1

Section titled “Fabric and NeoForge 1.20.4 to 1.20.6, NeoForge 1.20.1 to 1.20.2, Fabric 1.17 to 1.20.3, Forge 1.17.1 to 1.20.1”

Uses:

  • minecraft:mineable/pickaxe
  • minecraft:needs_iron_tool
  • BlockTags.MINEABLE_WITH_PICKAXE

In src/main/resources/data/minecraft/tags/blocks/mineable/pickaxe.json, add this to the list at /values:

"examplemod:ruby_block"

In src/main/resources/data/minecraft/tags/blocks/needs_iron_tool.json, add this to the list at /values:

"examplemod:ruby_block"

Uses:

  • minecraft:mineable/pickaxe
  • minecraft:needs_iron_tool
  • BlockTags.MINEABLE_WITH_PICKAXE

In src/main/resources/data/minecraft/tags/block/mineable/pickaxe.json, add this to the list at /values:

"examplemod:ruby_block"

In src/main/resources/data/minecraft/tags/block/needs_iron_tool.json, add this to the list at /values:

"examplemod:ruby_block"

Linen’s How-tos library has this page too, with the example for your own mod’s loader and Minecraft version. Hover a name in your code and Linen points to the how-tos that explain it. Both are free. Download Linen.