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

Adding Multiple Items Using the Same File

To add multiple items to the same file, you need to make a small change to the item file you created in Hour 4. Listing 5.1 shows the file from the end of Hour 4.

LISTING 5.1 ItemKey File from Hour 4

package com.wuppy.samsmod;import net.minecraft.creativetab.CreativeTabs;import net.minecraft.item.Item;public class ItemKey extends Item{        private String name = "key";        public ItemKey()        {               setUnlocalizedName(SamsMod.MODID + "_" + name);               setTextureName(SamsMod.MODID + ":" + name);               setCreativeTab(CreativeTabs.tabMisc);        }}

Turning this file into a file that can register multiple items is really easy. You can’t ...

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