Hey guys, my name is Benjamin and I am going to help you make YOUR minecraft FORGE mod.
I will be editing this topic constantly so please follow this post and return regularly to see when I add new stuff I add here to help you guys make your very own Minecraft Forge Mod legitimately without a mod maker.
Don't worry if you are not a professional programmer.
Watch the videos in the spoilers and it will show you how to code and will teach you enough to start your own mod
public class GemItems extends Item {
public GemItems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); //Tells the game what creative mode tab it goes in
}
}
The GemItem.java code will be inactive later in the modding tutorial, so keep that in mind
public BlockName(int par1, String texture) {
super(par1, Material.rock);
setCreativeTab(CreativeTabs.tabBlock); //place in creative tabs
}
//drops when broken with pickaxe
public int idDropped(int par1, Random par2Random, int par3)
{
return MainClass.ITEM.itemID;
}
public int quantityDropped(Random random)
{
return 3;
}
}
Here is the code to declare the RubyBlock
BlockName= new NewBlockClass(3608, "BlockName_Whatever").setUnlocalizedName("Texture_For_Block").setHardness(2.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F);
GameRegistry.registerBlock(BlockName, "BlockName");
LanguageRegistry.addName(BlockName, "Blood Name");
I will be editing this topic constantly so please follow this post and return regularly to see when I add new stuff I add here to help you guys make your very own Minecraft Forge Mod legitimately without a mod maker.
Don't worry if you are not a professional programmer.
Watch the videos in the spoilers and it will show you how to code and will teach you enough to start your own mod
Here's the code for the Main Class:
package Minecraftman240.Tutorial; //Package directory
/*
* Basic importing
*/
import net.minecraft.block.Block;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraftforge.common.EnumHelper;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
/*___________________________________________________________
* Basic needed forge stuff
_____________________________________________________________*/
@Mod(modid="TutorialMod",name="Tutorial Mod",version="v1")
@NetworkMod(clientSideRequired=true,serverSideRequired=false)
public class TutorialMod {
/*___________________________________________________________
* ToolMaterial
_____________________________________________________________*/
/*___________________________________________________________
*Telling forge that we are creating these
_____________________________________________________________*/
/*___________________________________________________________
*Declaring Init
_____________________________________________________________*/
@Init
public void load(FMLInitializationEvent event){
/*___________________________________________________________
*Define Items/Blocks
_____________________________________________________________*/
/*___________________________________________________________
*Adding Names
_____________________________________________________________*/
/*___________________________________________________________
*Crafting
_____________________________________________________________*/
}
}
Here's the code for our Gem Items class:
package Minecraftman240.Tutorial;
import net.minecraft.item.Item;
import cpw.mods.fml.relauncher.*;
import net.minecraft.creativetab.CreativeTabs;
public class GemItems extends Item {
public GemItems(int par1) {
super(par1); //Returns super constructor: par1 is ID
setCreativeTab(CreativeTabs.tabMaterials); //Tells the game what creative mode tab it goes in
}
}
Here is the code for our RubyBlock
package Your.Package;
import java.util.Random;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IconRegister;
import net.minecraft.creativetab.CreativeTabs;
public class NewBlockClass extends Block {
public BlockName(int par1, String texture) {
super(par1, Material.rock);
setCreativeTab(CreativeTabs.tabBlock); //place in creative tabs
}
//drops when broken with pickaxe
public int idDropped(int par1, Random par2Random, int par3)
{
return MainClass.ITEM.itemID;
}
public int quantityDropped(Random random)
{
return 3;
}
}
Here is the code to declare the RubyBlock
BlockName= new NewBlockClass(3608, "BlockName_Whatever").setUnlocalizedName("Texture_For_Block").setHardness(2.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F);
GameRegistry.registerBlock(BlockName, "BlockName");
LanguageRegistry.addName(BlockName, "Blood Name");
*Video Coming Soon*
Here is the static code
static Item RubyPick;
Here is the ToolMaterial code
static EnumToolMaterial EnumToolMaterialRuby = EnumHelper.addToolMaterial ("MedPower", 2, 650, 4.0F, 4, 25);
Here is the Code to Define our Tool
RubyPick = new TutPick(2011, EnumToolMaterialRuby).setUnlocalizedName("rubypick");
Here is the LanguageRegistry code
LanguageRegistry.addName(RubyPick, "Ruby Pick");
Here is the code for the TutPick.Java
package Minecraftman240.Tutorial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.ItemPickaxe;
public class TutPick extends ItemPickaxe {
public TutPick(int ItemID, EnumToolMaterial material) {
super (ItemID, material);
}
}
*Video Coming Soon*
Here is the static code
static BiomeGenBase TutBiome;
Here is the Define code
TutBiome = new TutBiome(24).setBiomeName("Tutorial Biome").setTemperatureRainfall(2.0F, 2.0F);
GameRegistry.addBiome(TutBiome);
Here is the TutBiome.java code
package Minecraftman240.Tutorial;
import net.minecraft.block.Block;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraft.world.biome.SpawnListEntry;
public class TutBiome extends BiomeGenBase {
public TutBiome(int part1) {
super(part1);
this.topBlock = (byte) Block.grass.blockID;
this.fillerBlock = (byte) Block.blockClay.blockID;
this.waterColorMultiplier = 0xE01B1B;
this.setMinMaxHeight(50.0F, 150.2F);
this.spawnableCreatureList.add(new SpawnListEntry(EntityPig.class, 2, 4, 8));
this.spawnableCreatureList.add(new SpawnListEntry(EntityCow.class, 2, 4, 8));
this.theBiomeDecorator.treesPerChunk = 12;
this.theBiomeDecorator.flowersPerChunk = 2;
this.theBiomeDecorator.grassPerChunk = 10;
}
}