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 a Basic Block

Now that you know what you will be making, it’s time to actually make it.

The Mod File Code

Adding a block to Minecraft is quite similar to adding an item. You start with creating a Block object. The name you choose should be something recognizable and should represent the block it will be. The block that you create in this hour is an ore. This ore will drop dust that can be smelted into ingots and those ingots will be used to create Sam’s armor pieces. The name of the block will be samStone. You will add two more lines of code to the mod file. Both of them are very similar to the item lines.

You must add a line to initialize the block. The class that it will initialize with will be called BlockSamStone. BlockSamStone ...

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