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 Tile Entity

Before actually creating the TileEntity class, it is a good idea to register it in the mod file first. Just like most other things you have to register for your mod, you can do this using the GameRegistry class. You use a method called registerTileEntity, which looks like the following for TileEntitySam:

GameRegistry.registerTileEntity(TileEntitySam.class, "TE_samTE");

The first parameter in this method is the tile entity you want to register, followed by .class. The second parameter is the unlocalized name of the tile entity. However, because the tile entity will never show its name, it’s not required to add a localization for it in the en_US.lang file.

Now it’s time to actually create 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