Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.flaghacker.myMod;
- import net.minecraft.block.Block;
- import net.minecraft.creativetab.CreativeTabs;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import cpw.mods.fml.common.Mod;
- import cpw.mods.fml.common.Mod.EventHandler;
- import cpw.mods.fml.common.event.FMLInitializationEvent;
- import cpw.mods.fml.common.event.FMLPreInitializationEvent;
- import cpw.mods.fml.common.registry.GameRegistry;
- //Initiate mod settings
- @Mod(modid = MyMod.MODID, version = MyMod.VERSION)
- public class MyMod {
- //Variables
- public static final String MODID = "MyMod";
- public static final String VERSION = "0.0";
- //Make a variables
- public static Block blockRed;
- public static Item itemDisk;
- //Create creative tab
- public static CreativeTabs myModTab1 = new CreativeTabs("myModTab1") {
- public Item getTabIconItem() {
- return Items.emerald;
- }
- };
- @EventHandler
- public void init(FMLPreInitializationEvent event) {
- //Make block
- blockRed = new BlockRed();
- blockRed.setBlockName("blockRed");
- blockRed.setCreativeTab(myModTab1);
- blockRed.setBlockTextureName(MODID + ":blockRed");
- GameRegistry.registerBlock(blockRed, "blockRed");
- //Make item
- itemDisk = new Item();
- itemDisk.setUnlocalizedName("itemDisk");
- itemDisk.setCreativeTab(myModTab1);
- itemDisk.setTextureName(MODID + ":itemDisk");
- GameRegistry.registerItem(itemDisk, "itemDisk");
- }
- @EventHandler
- public void init(FMLInitializationEvent event) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment