O'Reilly logo

Minecraft™ Mod Development in 24 Hours, Sams Teach Yourself by Jimmy Koene

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating Special Tools for Harvesting Different Blocks

Because there are only five vanilla tools, the selection is quite limited. Sometimes a mod should contain a custom tool. This book can’t cover every type of custom tool. Instead, you learn how to create your own custom tools by creating a paxel. A paxel is a pickaxe and axe in one.

The Mod File Code

The code in the mod file for a paxel is exactly the same as for any other tool. This has to be added to the class itself:

public static Item sampaxel;

And these two lines have to be added to the preInit method:

sampaxel = new ItemSamPaxel(sampaxel, "sampaxel");GameRegistry.registerItem(sampaxel, "SamsPaxel");

Creating the ItemSamPaxel Class

Create ItemSamPaxel ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required