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 Custom WorldGen Class

The custom WorldGen class for the generation of Sam’s Plant will be called WorldGenSamPlant. It’s useful, but not required, to make sure the name of every world generation file starts with WorldGen. This makes code easier to read. To create a new class, simply right-click the package your mod is in and select Create Class. After typing the name in the window that pops up, click Finish. This creates a class that should look like Listing 14.1.

LISTING 14.1 Initial WorldGenSamPlant Class

package com.wuppy.samsmod;public class WorldGenSamPlant{}

To make sure WorldGenSamPlant will actually work as a WorldGen class, it has to extend WorldGenerator. Once you add the extends WorldGenerator ...

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