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

Making Half Blocks

You now learn how to make a half block. These blocks are not in the final version of Sam’s Mod, but they are commonly used in mods, so it is important to know.

To make sure a block isn’t a 1×1×1 square, you need a single line of code in the constructor along with one method to make sure the blocks around it look good as well.

The line of code you have to add to the constructor is as follows:

this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);

This method contains six float values. The first three are the x, y, and z values of the starting position and the last three are the x, y, and z of the ending position. The starting position is the bottom corner with the lowest x and z value, and the ...

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