Tools are essential for survival and progression, allowing players to gather resources, construct buildings, and defend themselves.
Creating a Tool Material
You can create a tool material by instantiating a new ToolMaterial object and storing it in a field that can be used later to create the tool items that use the material.
java
public static final ToolMaterial GUIDITE_TOOL_MATERIAL = new ToolMaterial(
BlockTags.INCORRECT_FOR_WOODEN_TOOL,
455,
5.0F,
1.5F,
22,
GuiditeArmorMaterial.REPAIRS_GUIDITE_ARMOR
);1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
The ToolMaterial constructor accepts the following parameters, in this specific order:
| Parameter | Description |
|---|---|
incorrectBlocksForDrops | If a block is in the incorrectBlocksForDrops tag, it means that when you use a tool made from this ToolMaterial on that block, the block will not drop any items. |
durability | The durability of all tools that are of this ToolMaterial. |
speed | The mining speed of the tools that are of this ToolMaterial. |
attackDamageBonus | The additional attack damage of the tools that are of this ToolMaterial will have. |
enchantmentValue | The "Enchantability" of tools which are of this ToolMaterial. |
repairItems | Any items within this tag can be used to repair tools of this ToolMaterial in an anvil. |
If you're struggling to determine balanced values for any of the numerical parameters, you should consider looking at the vanilla tool material constants, such as ToolMaterial.STONE or ToolMaterial.DIAMOND.
Creating Tool Items
Using the same utility function as in the Creating Your First Item guide, you can create your tool items:
java
public static final Item GUIDITE_SWORD = register(
"guidite_sword",
settings -> new SwordItem(GUIDITE_TOOL_MATERIAL, 1f, 1f, settings),
new Item.Settings()
);1
2
3
4
5
2
3
4
5
The two float values (1f, 1f) refer to the attack damage of the tool and the attack speed of the tool respectively.
Remember to add them to an item group if you want to access them from the creative inventory!
java
ItemGroupEvents.modifyEntriesEvent(ItemGroups.TOOLS)
.register((itemGroup) -> itemGroup.add(ModItems.GUIDITE_SWORD));1
2
2
You will also have to add a texture, item translation and item model. However, for the item model, you'll want to use the item/handheld model as your parent instead of the usual item/generated.
For this example, I will be using the following model and texture for the "Guidite Sword" item:
json
{
"parent": "minecraft:item/handheld",
"textures": {
"layer0": "fabric-docs-reference:item/guidite_sword"
}
}1
2
3
4
5
6
2
3
4
5
6
That's pretty much it! If you go in-game you should see your tool item(s) in the tools tab of the creative inventory menu.



