Tools are essential for survival and progression, allowing players to gather resources, construct buildings, and defend themselves.
Creating a Tool Material
INFO
If you're creating multiple tool materials, consider using an Enum to store them. Vanilla does this in the ToolMaterials class, which stores all the tool materials that are used in the game.
This class can also be used to determine your tool material's properties in relation to vanilla tool materials.
You can create a tool material by creating a new class that inherits it - in this example, I'll be creating "Guidite" tools:
java
public class GuiditeMaterial implements ToolMaterial {
// Your IDE should override the interface's methods for you, or at least shout at you to do so.
}1
2
3
2
3
The tool material tells the game the following information:
Durability -
getDurability()How many times the tool can be used before breaking.
Example
java@Override public int getDurability() { return 455; }1
2
3
4
5Mining Speed -
getMiningSpeedMultiplier()If the tool is used to break blocks, how fast should it break the blocks?
For reference purposes, the diamond tool material has a mining speed of
8.0Fwhilst the stone tool material has a mining speed of4.0F.Example
java@Override public float getMiningSpeedMultiplier() { return 5.0F; }1
2
3
4
5Attack Damage -
getAttackDamage()How many points of damage should the tool do when used as a weapon against another entity?
Example
java@Override public float getAttackDamage() { return 1.5F; }1
2
3
4
5Mining Level -
getMiningLevel()What blocks can be broken by this tool? Can it mine diamonds?
A mining level of 3+ is needed to require obsidian whilst a level of 2 is required to mine diamonds.
Example
java@Override public int getMiningLevel() { return 3; }1
2
3
4
5Enchantability -
getEnchantability()How easy is it to get better and higher level enchantments with this item? For reference, Gold has an enchantability of 22 whilst Netherite has an enchantability of 15.
Example
java@Override public int getEnchantability() { return 22; }1
2
3
4
5Repair Ingredient(s) -
getRepairIngredient()What item or items are used to repair the tool?
Example
java@Override public Ingredient getRepairIngredient() { return Ingredient.ofItems(ModItems.SUSPICIOUS_SUBSTANCE, Items.POTATO); }1
2
3
4
5
Once you have created your tool material and tweaked it to your likings, you can create an instance of it to be used in the tool item constructors.
java
public static final GuiditeMaterial INSTANCE = new GuiditeMaterial();1
Creating Tool Items
Using the same way you registered your first item, you should register each tool similarly:
java
public static final Item GUIDITE_SWORD = register(new SwordItem(GuiditeMaterial.INSTANCE, 2, 0.5F, new FabricItemSettings()), "guidite_sword");1
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.
For this example, I will be using the following model and texture for the "Guidite Sword" item:
json
{
"parent": "item/handheld",
"textures": {
"layer0": "example-mod: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.



